<?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=Uagrawa</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=Uagrawa"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Uagrawa"/>
	<updated>2026-06-18T11:09:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114785</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114785"/>
		<updated>2017-12-13T19:01:00Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the edit.html.erb following code changes were made. Setting the remote to true ensures that the following is an ajax request and not and html request. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_for @assignment_form.assignment, html: { id: 'assignment_form', :remote=&amp;gt;true } do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render &amp;quot;layouts/flash_notices&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the submission directory field, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
In general.html.erb for ajax view, the following code is rendered for displaying the flash messages. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114767</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114767"/>
		<updated>2017-12-13T09:12:46Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the edit.html.erb following code changes were made. Setting the remote to true ensures that the following is an ajax request and not and html request. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_for @assignment_form.assignment, html: { id: 'assignment_form', :remote=&amp;gt;true } do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render &amp;quot;layouts/flash_notices&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the submission directory field, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
In general.html.erb for ajax view, the following code is rendered for displaying the flash messages. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Create New &amp;lt;% if params[:private] == &amp;quot;1&amp;quot; %&amp;gt;Private &amp;lt;% else %&amp;gt;Public &amp;lt;% end %&amp;gt;Assignment&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_for @assignment_form.assignment, html: { id: 'assignment_form'} do %&amp;gt;&lt;br /&gt;
    &amp;lt;div class= &amp;quot;chart-table&amp;quot; id=&amp;quot;tabs&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#tabs-1&amp;quot; id=&amp;quot;General&amp;quot;&amp;gt;General&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#tabs-2&amp;quot; id=&amp;quot;Rubrics&amp;quot;&amp;gt;Rubrics&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#tabs-3&amp;quot; id=&amp;quot;ReviewStrategy&amp;quot;&amp;gt;Review strategy&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#tabs-4&amp;quot; id=&amp;quot;DueDates&amp;quot;&amp;gt;Due dates&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;%if @assignment_form.assignment.is_calibrated%&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#tabs-5&amp;quot; id=&amp;quot;Calibration&amp;quot;&amp;gt;Calibration&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;%end%&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tabs-1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;%= render 'assignments/edit/general' %&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tabs-2&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;%= render 'assignments/edit/rubrics' %&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tabs-3&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;%= render 'assignments/edit/review_strategy' %&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
      &amp;lt;div id=&amp;quot;tabs-4&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;%= render 'assignments/edit/due_dates' %&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;&lt;br /&gt;
      &amp;lt;%if @assignment_form.assignment.is_calibrated%&amp;gt;&lt;br /&gt;
        &amp;lt;div id=&amp;quot;tabs-5&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;%= render 'assignments/edit/calibration' %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
      &amp;lt;%end%&amp;gt;&lt;br /&gt;
      &amp;lt;%= button_tag &amp;quot;Save&amp;quot;, :id =&amp;gt; 'submit_btn' %&amp;gt; | &amp;lt;%= render :partial =&amp;gt; '/shared_scripts/back' %&amp;gt;&lt;br /&gt;
     &amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
      var useBookmarkChanged = function () {&lt;br /&gt;
          jQuery(&amp;quot;#questionnaire_table_BookmarkRatingQuestionnaire&amp;quot;).remove()&lt;br /&gt;
          var bookmark_checkbox = jQuery('#assignment_form_assignment_use_bookmark');&lt;br /&gt;
          if (bookmark_checkbox.is(':checked')) {&lt;br /&gt;
            addQuestionnaireTableRow(&lt;br /&gt;
                    'BookmarkRatingQuestionnaire',&lt;br /&gt;
                    null,&lt;br /&gt;
                    &amp;lt;%= questionnaire(@assignment_form.assignment, 'BookmarkRatingQuestionnaire',nil).to_json.html_safe %&amp;gt;,&lt;br /&gt;
                    &amp;lt;%= assignment_questionnaire(@assignment_form.assignment, 'BookmarkRatingQuestionnaire',nil).to_json.html_safe %&amp;gt;,&lt;br /&gt;
                    &amp;lt;%= questionnaire_options(@assignment_form.assignment, 'BookmarkRatingQuestionnaire',nil).to_json.html_safe %&amp;gt;&lt;br /&gt;
            );&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
      jQuery(document).ready(function () {&lt;br /&gt;
        jQuery(&amp;quot;#submit_btn&amp;quot;).click(function(e) {&lt;br /&gt;
          var max_team_size = jQuery('#assignment_form_assignment_max_team_size').val();&lt;br /&gt;
          if (max_team_size == '1' &amp;amp;&amp;amp; jQuery('#team_assignment').is(':checked')) {&lt;br /&gt;
              alert(&amp;quot;Maxinum number of members per team must be greater than 1!&amp;quot;);&lt;br /&gt;
              e.preventDefault()&lt;br /&gt;
          }&lt;br /&gt;
        })&lt;br /&gt;
        jQuery(&amp;quot;#tabs&amp;quot;).tabs({&lt;br /&gt;
          beforeActivate: function (event, ui) {&lt;br /&gt;
            var deleteTeam = 0;&lt;br /&gt;
            var frm = jQuery(&amp;quot;#assignment_form&amp;quot;);&lt;br /&gt;
            var max_team_size = jQuery('#assignment_form_assignment_max_team_size').val();&lt;br /&gt;
            if (max_team_size == '1' &amp;amp;&amp;amp; jQuery('#team_assignment').is(':checked')) {&lt;br /&gt;
              deleteTeam = 1;&lt;br /&gt;
              alert(&amp;quot;Maxinum number of members per team must be greater than 1!&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            if (deleteTeam == 0) {&lt;br /&gt;
              jQuery.ajax({&lt;br /&gt;
                url: frm.attr('action'),&lt;br /&gt;
                method: frm.attr('method'),&lt;br /&gt;
                data: frm.serialize(),&lt;br /&gt;
              })&lt;br /&gt;
            } else {&lt;br /&gt;
              event.preventDefault();&lt;br /&gt;
            }&lt;br /&gt;
          }&lt;br /&gt;
        });&lt;br /&gt;
        if (&amp;lt;%= params[:tab]=='tab3'%&amp;gt;) {&lt;br /&gt;
          $('#ReviewStrategy').click();&lt;br /&gt;
        }&lt;br /&gt;
      });&lt;br /&gt;
&lt;br /&gt;
      $('#go_to_tabs2').click(function(){&lt;br /&gt;
        $('#Rubrics').click();&lt;br /&gt;
      });&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114766</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114766"/>
		<updated>2017-12-13T09:11:23Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the edit.html.erb following code changes were made. Setting the remote to true ensures that the following is an ajax request and not and html request. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_for @assignment_form.assignment, html: { id: 'assignment_form', :remote=&amp;gt;true } do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render &amp;quot;layouts/flash_notices&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the submission directory field, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
In general.html.erb for ajax view, the following code is rendered for displaying the flash messages. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114765</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114765"/>
		<updated>2017-12-13T09:06:04Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the edit.html.erb following code changes were made. Setting the remote to true ensures that the following is an ajax request and not and html request. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%= form_for @assignment_form.assignment, html: { id: 'assignment_form', :remote=&amp;gt;true } do %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render &amp;quot;layouts/flash_notices&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the submission directory field, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114764</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114764"/>
		<updated>2017-12-13T08:57:26Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the submission directory field, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114763</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114763"/>
		<updated>2017-12-13T08:56:05Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page. The below implementation ensures that there are no special characters in the path, course_id is unique and name is always present.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114762</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114762"/>
		<updated>2017-12-13T08:52:24Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following code was added in the assignment.rb for validation of our page.&lt;br /&gt;
&lt;br /&gt;
  validates :name, presence: true&lt;br /&gt;
  validates :name, uniqueness: {scope: :course_id}&lt;br /&gt;
  validate :valid_num_review&lt;br /&gt;
  validates :directory_path, format: {with: /\A[a-zA-Z0-9]+\Z/ , message: &amp;quot;Please  follow the guidelines&amp;quot; }, presence:true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114761</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114761"/>
		<updated>2017-12-13T08:48:28Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114760</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114760"/>
		<updated>2017-12-13T08:47:32Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the general.html.erb for ajax view if there is an error or if the saved changes are updated then it shows a flash message. &lt;br /&gt;
&lt;br /&gt;
 $(&amp;quot;#flash&amp;quot;).html('&amp;lt;%= j render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;div id=&amp;quot;flash&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;% if notice.present? %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render partial: &amp;quot;shared/notice_banner&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114759</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114759"/>
		<updated>2017-12-13T07:12:05Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Tooltips Functionality==&lt;br /&gt;
&lt;br /&gt;
The Tooltips functionalities are throughly checked in various browsers and the following screenshots show that they are supported across various browsers.&lt;br /&gt;
The images show in Firefox and Internet Explorer browsers.&lt;br /&gt;
[[Image:Check11.jpg]]&lt;br /&gt;
[[Image:Check13.jpg]]&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114758</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114758"/>
		<updated>2017-12-13T07:09:01Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
In the assignments_controller.rb controller, under the function create, we created a condition or blocking it from saving and then updating all the tabs with the assignment id it needs.&lt;br /&gt;
&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114756</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114756"/>
		<updated>2017-12-13T07:03:56Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
assignments_controller.rb&lt;br /&gt;
def create&lt;br /&gt;
@assignment_form = AssignmentForm.new(assignment_form_params)&lt;br /&gt;
    if params[:button]&lt;br /&gt;
        if @assignment_form.save&lt;br /&gt;
           @assignment_form.create_assignment_node&lt;br /&gt;
           existAssignment = Assignment.find_by_name(@assignment_form.assignment.name)&lt;br /&gt;
           assignment_form_params[:assignment][:id] = existAssignment.id.to_s&lt;br /&gt;
           quesparams = assignment_form_params&lt;br /&gt;
           questArray = quesparams[:assignment_questionnaire]&lt;br /&gt;
           dueArray = quesparams[:due_date]&lt;br /&gt;
           questArray.each do |curquestionnaire|&lt;br /&gt;
           curquestionnaire[:assignment_id] = existAssignment.id.to_s&lt;br /&gt;
          end&lt;br /&gt;
              dueArray.each do |curDue|&lt;br /&gt;
                curDue[:parent_id] = existAssignment.id.to_s&lt;br /&gt;
              end&lt;br /&gt;
              quesparams[:assignment_questionnaire] = questArray&lt;br /&gt;
              quesparams[:due_date] = dueArray&lt;br /&gt;
              @assignment_form.update(quesparams,current_user)&lt;br /&gt;
               aid = Assignment.find_by_name(@assignment_form.assignment.name).id&lt;br /&gt;
               redirect_to edit_assignment_path aid&lt;br /&gt;
                return&lt;br /&gt;
                undo_link(&amp;quot;Assignment \&amp;quot;#{@assignment_form.assignment.name}\&amp;quot; has been created successfully. &amp;quot;)&lt;br /&gt;
                else&lt;br /&gt;
                  flash.now[:error] = &amp;quot;Failed to create assignment&amp;quot;&lt;br /&gt;
                  render 'new'&lt;br /&gt;
                  end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114755</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114755"/>
		<updated>2017-12-13T07:00:37Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
==='''Code Changes===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114752</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114752"/>
		<updated>2017-12-13T06:42:22Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
In the present implementation of the project, under the edit assignment page, even if we change the tab or click a tab a save request is sent in the background and the metrics are being saved. So, in this case when we have to save a view for a assignment page, we cannot actually do that because on every tab or every change of tab it needs an assignment id. But in case of new assignment page, we do not have an assignment id yet and we did not create the assignment.&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114751</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=114751"/>
		<updated>2017-12-13T06:28:25Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt; Validating the user entries which is submission directory. It states that it is mandatory field and there should be no spaces but does it actually validate.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Implementation==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
The new view also renders tab a titled &amp;quot;Due Dates&amp;quot; where the instructor can select the deadlines for various rounds of the selected rubrics. This tab also allows the instructor to select the late penalty policy&lt;br /&gt;
The instructor can also choose to make a new late policy instead of selecting an existing policy created by the same instructor.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignment_creation_spec.rb&lt;br /&gt;
&amp;lt;br/&amp;gt;assignments_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;br /&gt;
&lt;br /&gt;
Below are some of the test cases added&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab review strategy&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review Strategy&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show tab due deadlines&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Due date').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Deadline type&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
                                         deadline_type_id: submission_type_id,&lt;br /&gt;
                                         type: 'AssignmentDueDate'&lt;br /&gt;
                                     )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
                                     deadline_type_id: review_type_id,&lt;br /&gt;
                                     type: 'AssignmentDueDate'&lt;br /&gt;
                                 )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;is able show tab rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    it &amp;quot;is able show attributes in rubrics&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('Rubrics').click&lt;br /&gt;
      expect(page).to have_content(&amp;quot;rubric varies by round&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
   it &amp;quot;sets attributes for review strategy auto selects&amp;quot; do&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit '/assignments/new?private=0'&lt;br /&gt;
      fill_in 'assignment_form_assignment_name', with: 'public assignment for test'&lt;br /&gt;
      select('Course 2', from: 'assignment_form_assignment_course_id')&lt;br /&gt;
      fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory'&lt;br /&gt;
      find_link('ReviewStrategy').click&lt;br /&gt;
      select &amp;quot;Auto-Selected&amp;quot;, from: 'assignment_form_assignment_review_assignment_strategy'&lt;br /&gt;
      fill_in 'assignment_form_assignment_review_topic_threshold', with: 3&lt;br /&gt;
      fill_in 'assignment_form_assignment_max_reviews_per_submission', with: 10&lt;br /&gt;
      click_button 'Create'&lt;br /&gt;
      assignment = Assignment.where(name: 'public assignment for test').first&lt;br /&gt;
      expect(assignment).to have_attributes(&lt;br /&gt;
                                review_assignment_strategy: 'Auto-Selected',&lt;br /&gt;
                                review_topic_threshold: 3,&lt;br /&gt;
                                max_reviews_per_submission: 10&lt;br /&gt;
                            )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
 describe &amp;quot;deadlines&amp;quot;, js: true do&lt;br /&gt;
    before(:each) do&lt;br /&gt;
      @assignment = create(:assignment, name: 'public assignment for test')&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      visit &amp;quot;/assignments/#{@assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'Due date'&lt;br /&gt;
    end&lt;br /&gt;
    # instructor can set deadline for review and taking quiz&lt;br /&gt;
    it &amp;quot;set the deadline for an assignment review&amp;quot; do&lt;br /&gt;
      fill_in 'assignment_form_assignment_rounds_of_reviews', with: '1'&lt;br /&gt;
      fill_in 'datetimepicker_submission_round_1', with: (Time.now.in_time_zone + 1.day).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      fill_in 'datetimepicker_review_round_1', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
      click_button 'submit_btn'&lt;br /&gt;
      submission_type_id = DeadlineType.where(name: 'submission')[0].id&lt;br /&gt;
      review_type_id = DeadlineType.where(name: 'review')[0].id&lt;br /&gt;
      submission_due_date = DueDate.find(1)&lt;br /&gt;
      review_due_date = DueDate.find(2)&lt;br /&gt;
      expect(submission_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: submission_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
      expect(review_due_date).to have_attributes(&lt;br /&gt;
        deadline_type_id: review_type_id,&lt;br /&gt;
        type: 'AssignmentDueDate'&lt;br /&gt;
      )&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Test cases which were modified&lt;br /&gt;
&lt;br /&gt;
   it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
 +        allow(assignment_form).to receive(:update).with(any_args).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
          allow(assignment).to receive(:id).and_return(1)&lt;br /&gt;
          allow(Assignment).to receive(:find_by_name).with('test assignment').and_return(assignment)&lt;br /&gt;
         allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
           .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
         post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
&lt;br /&gt;
   context 'when assignment_form is saved successfully' do&lt;br /&gt;
       it 'redirets to assignment#edit page' do&lt;br /&gt;
          allow(assignment_form).to receive(:assignment).and_return(assignment)&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_form).to receive(:create_assignment_node).and_return(double('node'))&lt;br /&gt;
 +        allow(existAssignment).to receive(:id).and_return(1)&lt;br /&gt;
 +        allow(Assignment).to receive(:find_by_name).with('test assignment').and_return([double('Assignment', id: 1)])&lt;br /&gt;
          allow_any_instance_of(AssignmentsController).to receive(:undo_link)&lt;br /&gt;
            .with('Assignment &amp;quot;test assignment&amp;quot; has been created successfully. ').and_return(true)&lt;br /&gt;
          post :create, @params&lt;br /&gt;
         expect(response).to redirect_to('/assignments/1/edit')&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
    context 'when assignment_form is not saved successfully' do&lt;br /&gt;
        it 'renders assignment#new page' do&lt;br /&gt;
          allow(assignment_form).to receive(:save).and_return(false)&lt;br /&gt;
 -        post :create, @params&lt;br /&gt;
 +        params = {button: 1}&lt;br /&gt;
 +        post :create, params&lt;br /&gt;
          expect(response).to render_template(:new)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:!Firefox_test.png&amp;diff=114747</id>
		<title>File:!Firefox test.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:!Firefox_test.png&amp;diff=114747"/>
		<updated>2017-12-13T05:34:47Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Firefox_test.png&amp;diff=114738</id>
		<title>File:Firefox test.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Firefox_test.png&amp;diff=114738"/>
		<updated>2017-12-13T05:04:16Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Firefox.png&amp;diff=114737</id>
		<title>File:Firefox.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Firefox.png&amp;diff=114737"/>
		<updated>2017-12-13T04:58:51Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=113545</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=113545"/>
		<updated>2017-11-15T03:59:19Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Approach==&lt;br /&gt;
New assignment creation form will render forms to set Due Dates, Review Strategy and Rubrics as a table. Currently application ID is required to edit these options for an application. We will modify application/views and application controller to support adding these options while creation without application ID without breaking existing edit functionality.&lt;br /&gt;
&lt;br /&gt;
In the present implementation the save button is handled by JQuery but only until a point where necessary attribute checks are done. Now, we need to prevent the page from reloading which can be done by mentioning a remote value as true in the form tag for the edit assignment page.&lt;br /&gt;
 &lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Rubrics.png]]&lt;br /&gt;
&lt;br /&gt;
In the improved view, in addition to supporting the General tab, now there are new tabs like &amp;quot;Rubrics&amp;quot;.&lt;br /&gt;
This tab allows the instructor to select the various rubrics for the new assignment. This page also allows the setting of different rubrics for each round of the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_Review_Strategy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the improved view, there will be an additional new tab titled &amp;quot;Review Strategy&amp;quot;.&lt;br /&gt;
This tab allows the instructor to set the various policies for review of the new assignment. This page also allows assigning manual review strategies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:New_View_New_Assignment_Assign_DueDates.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=113519</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=113519"/>
		<updated>2017-11-15T03:51:55Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics.  Also, when we press the save button while creating or editing an assignment it goes to HTML form request, instead it should be changed to AJAX request so that the page does not need to get refreshed every time user saves the changes. Few other minor issues are validating the user entries and fixing tooltips so that they are supported across all the browsers.( Chrome, Safari, Firefox etc.)&lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
&amp;lt;br/&amp;gt;Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
&amp;lt;br/&amp;gt;When an Instructor creates a new assignment, he should be able to see a table to set DueDates, Review Strategy options and Rubrics associated with the assignments. These options are currently available to the instructor while editing an assignment. We will be adding options to be set during creation of new assignment. Fields to add suggested topics will be excluded for new assignment creation.&lt;br /&gt;
&amp;lt;br/&amp;gt;Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
&amp;lt;br/&amp;gt;Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
==Use Case Diagram:==&lt;br /&gt;
&lt;br /&gt;
[[File:Assignment_use_case.png]]&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Approach==&lt;br /&gt;
In the improved view of New Assignment instructor will be able to specify details under four tabs as shown in the below screenshots&lt;br /&gt;
[[Image:New_View_New_Assignment_General.png]]&lt;br /&gt;
&lt;br /&gt;
In the General tab the instructor is now able to see all the options from the old view.&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan==&lt;br /&gt;
Manual and automated testing to be done for below cases. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  clicking on Manage-&amp;gt;Assignments should display all created assignments with correct directory, creation date, updation date, instructor id, and actions. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;actions of an assignment should successfully redirect to action page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public assignment,will redirected to &amp;quot;Create New Public Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new private assignment,will redirected to &amp;quot;Create New Private Assignment&amp;quot; Page.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on Manage-&amp;gt;Assignments-&amp;gt;new public/private assignment, &amp;quot;Create New Public/Private Assignment&amp;quot; should render a table with tabs &amp;quot;General&amp;quot;,  &amp;quot;Rubrics, &amp;quot;Review Strategy&amp;quot;,  &amp;quot;Due Dates&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, clicking on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot; page,  the tab should display table to select Questionnaire,  menu type, display style, weight and notification limit.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select review type, author feedback type, and Teammate review option from the drop down from  &amp;quot;Rubrics&amp;quot; tab.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Review Strategy from drop down on &amp;quot;Rubrics&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, set number of reviews done by each student on  &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set minimum number of reviews done for each submission on &amp;quot;Review Strategy&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, Set both calibrated and uncalibrated artifacts  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select Anonymous Review option on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, select allow self  review  on &amp;quot;Review Strategy&amp;quot; tab. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set due dates  on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of submissions allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of reviews allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  set number of teammate review allowed on  &amp;quot;Due Date&amp;quot; tab from &amp;quot;Create New Public/Private Assignment&amp;quot;.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor,  after updating the fields on all tabs and clicking on save should create an assignment form in database.&lt;br /&gt;
&amp;lt;br/&amp;gt;As an Instructor, after saving the new assignment, redirect to edit page to update Signup topics. &lt;br /&gt;
&amp;lt;br/&amp;gt;As an instructor, save should not reload the page while creating a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when instructor creates a empty template for assignment form.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when name of the assignment is not unique.&lt;br /&gt;
&amp;lt;br/&amp;gt; Test when late policy is not created for instructor, and instructor tries to create a new assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt;All Users should be able to see tooltip of respective actions on all Browsers.&lt;br /&gt;
&amp;lt;br/&amp;gt; As an instructor, delete an assignment.&lt;br /&gt;
&amp;lt;br/&amp;gt; Form submission validates the attributes of all associated models.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112610</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112610"/>
		<updated>2017-11-08T03:27:31Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
The current new assignment UI is a Rails based From, while the Assignment Edit Form is a multi level JavasScript based form (view/assignment/edit/.*) that consists of multiple inputs  and user interactions. When an instructor creates a new assignment, there are only a limited parameters that he can set in the creation page, then (s)he needs to edit the assignment to define the rest of the parameters. This is confusing and needs to be unified. One solution could be ditching the new assignment form (views/assignment/new.html.erb)&lt;br /&gt;
==Introduction:==&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics. &lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
&amp;lt;br/&amp;gt;2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/new.html.erb&lt;br /&gt;
&amp;lt;br/&amp;gt;views/assignment/*&lt;br /&gt;
&amp;lt;br/&amp;gt;controller/assignment_controller.rb&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112604</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112604"/>
		<updated>2017-11-08T03:25:46Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
The current new assignment UI is a Rails based From, while the Assignment Edit Form is a multi level JavasScript based form (view/assignment/edit/.*) that consists of multiple inputs  and user interactions. When an instructor creates a new assignment, there are only a limited parameters that he can set in the creation page, then (s)he needs to edit the assignment to define the rest of the parameters. This is confusing and needs to be unified. One solution could be ditching the new assignment form (views/assignment/new.html.erb)&lt;br /&gt;
==Introduction:==&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics. &lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
views/assignment/new.html.erb&lt;br /&gt;
views/assignment/*&lt;br /&gt;
controller/assignment_controller.rb&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Picture2.png&amp;diff=112603</id>
		<title>File:Picture2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Picture2.png&amp;diff=112603"/>
		<updated>2017-11-08T03:25:16Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: uploaded a new version of &amp;amp;quot;File:Picture2.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112601</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112601"/>
		<updated>2017-11-08T03:23:40Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
The current new assignment UI is a Rails based From, while the Assignment Edit Form is a multi level JavasScript based form (view/assignment/edit/.*) that consists of multiple inputs  and user interactions. When an instructor creates a new assignment, there are only a limited parameters that he can set in the creation page, then (s)he needs to edit the assignment to define the rest of the parameters. This is confusing and needs to be unified. One solution could be ditching the new assignment form (views/assignment/new.html.erb)&lt;br /&gt;
==Introduction:==&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics. &lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
views/assignment/new.html.erb&lt;br /&gt;
views/assignment/*&lt;br /&gt;
controller/assignment_controller.rb&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112598</id>
		<title>CSC/ECE 517 Fall 2017/E1796. Unify Create Assignment and Edit Assignment pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1796._Unify_Create_Assignment_and_Edit_Assignment_pages&amp;diff=112598"/>
		<updated>2017-11-08T03:21:24Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:[[File:Example.jpg]]&amp;lt;nowiki&amp;gt;Insert non-formatted text here&amp;lt;/nowiki&amp;gt;]]E1796. Unify Create Assignment and Edit Assignment pages&lt;br /&gt;
&lt;br /&gt;
The current new assignment UI is a Rails based From, while the Assignment Edit Form is a multi level JavasScript based form (view/assignment/edit/.*) that consists of multiple inputs  and user interactions. When an instructor creates a new assignment, there are only a limited parameters that he can set in the creation page, then (s)he needs to edit the assignment to define the rest of the parameters. This is confusing and needs to be unified. One solution could be ditching the new assignment form (views/assignment/new.html.erb)&lt;br /&gt;
==Introduction:==&lt;br /&gt;
==Problem Statement:==&lt;br /&gt;
In the Expertiza portal presently when an instructor wants to create a new assignment then as he selects a new assignment option only a few metrics are asked for while for mentioning the other metrics the professor needs to edit assignment and then under that he is shown the options to edit all the other metrics. &lt;br /&gt;
&lt;br /&gt;
==Scope of this Project: ==&lt;br /&gt;
Specific Improvements to assignment creation by navigating the user for creating a new assignment to edit assignment page(view/assignment/edit_assignment). &lt;br /&gt;
Making sure the edit assignment has blank fields in case of new assignment and saved fields in case of editing. &lt;br /&gt;
Fixes to tooltips so that it is supported across all the browsers&lt;br /&gt;
Change the save button to AJAX request instead of HTML form submission so that the page doesn’t need to get refreshed every time the user save the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Current Flow:==&lt;br /&gt;
This page is displayed in the present system when a professor wants to create a new assignment as we can see there are only very few metrics on this page which are being displayed. &lt;br /&gt;
&lt;br /&gt;
[[File:Picture1|thumb|Caption]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While under Edit assignment the professor can now mention all the various metrics regarding the assignment on this page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern==&lt;br /&gt;
1.MVC – The project is implemented in Ruby on Rails that uses MVC architecture.  It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).  &lt;br /&gt;
2.Dry Principle – We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication.  Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
=='''Files to be Modified==&lt;br /&gt;
view/assignment/edit/.*&lt;br /&gt;
views/assignment/new.html.erb&lt;br /&gt;
views/assignment/*&lt;br /&gt;
controller/assignment_controller.rb&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Picture1.png&amp;diff=112595</id>
		<title>File:Picture1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Picture1.png&amp;diff=112595"/>
		<updated>2017-11-08T03:13:01Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: uploaded a new version of &amp;amp;quot;File:Picture1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110938</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110938"/>
		<updated>2017-10-29T22:47:27Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Drawbacks and solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password). The testing has to be done manually. &lt;br /&gt;
&lt;br /&gt;
'''Following are a few test cases with respect to our code changes that can be tried from UI:'''&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
'''To check if the Tasks not yet started section has assignments highlighted with colours: '''&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
'''Edge Cases'''&lt;br /&gt;
&lt;br /&gt;
The edge case for when there are no past due assignments for a student has been handled. In this case, no past due assignments are displayed. &lt;br /&gt;
&lt;br /&gt;
The edge case for when there is only one assignment in the tasks not yet started section has been handled. In this case, the assignment is highlighted with a dark red colour.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110937</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110937"/>
		<updated>2017-10-29T22:46:28Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password). The testing has to be done manually. &lt;br /&gt;
&lt;br /&gt;
'''Following are a few test cases with respect to our code changes that can be tried from UI:'''&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
'''To check if the Tasks not yet started section has assignments highlighted with colours: '''&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
'''Edge Cases'''&lt;br /&gt;
&lt;br /&gt;
The edge case for when there are no past due assignments for a student has been handled. In this case, no past due assignments are displayed. &lt;br /&gt;
&lt;br /&gt;
The edge case for when there is only one assignment in the tasks not yet started section has been handled. In this case, the assignment is highlighted with a dark red colour.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110936</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110936"/>
		<updated>2017-10-29T22:42:39Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
'''Following are a few test cases with respect to our code changes that can be tried from UI:'''&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
'''To check if the Tasks not yet started section has assignments highlighted with colours: '''&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
'''Edge Cases'''&lt;br /&gt;
&lt;br /&gt;
The edge case for when there are no past due assignments for a student has been handled. In this case, no past due assignments are displayed. &lt;br /&gt;
&lt;br /&gt;
The edge case for when there is only one assignment in the tasks not yet started section has been handled. In this case, the assignment is highlighted with a dark red colour.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110935</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110935"/>
		<updated>2017-10-29T22:42:13Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
'''Following are a few test cases with respect to our code changes that can be tried from UI:'''&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
'''To check if the Tasks not yet started section has assignments highlighted with colours: '''&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Edge Cases'''&lt;br /&gt;
&lt;br /&gt;
The edge case for when there are no past due assignments for a student has been handled. In this case, no past due assignments are displayed. &lt;br /&gt;
&lt;br /&gt;
The edge case for when there is only one assignment in the tasks not yet started section has been handled. In this case, the assignment is highlighted with a dark red colour.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110934</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110934"/>
		<updated>2017-10-29T22:34:42Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
'''Following are a few test cases with respect to our code changes that can be tried from UI:'''&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
'''To check if the Tasks not yet started section has assignments highlighted with colours: '''&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110933</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110933"/>
		<updated>2017-10-29T22:33:36Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
To check if the Tasks not yet started section has assignments highlighted with colours:&lt;br /&gt;
&lt;br /&gt;
1. Login as a student and check if there are any assignments in tasks not started section.&lt;br /&gt;
&lt;br /&gt;
2. If no assignments are present, the student is not involved with any current assignments. &lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and add the student as a participant to few assignments. &lt;br /&gt;
&lt;br /&gt;
4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110925</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110925"/>
		<updated>2017-10-29T22:18:43Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below.&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110924</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110924"/>
		<updated>2017-10-29T22:18:31Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below &lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110923</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110923"/>
		<updated>2017-10-29T22:17:50Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* New Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Results===&lt;br /&gt;
&lt;br /&gt;
The task list before and after the changes are shown below &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Before Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====After Changes====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After changes.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described. &lt;br /&gt;
&lt;br /&gt;
The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_changes.png&amp;diff=110922</id>
		<title>File:After changes.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_changes.png&amp;diff=110922"/>
		<updated>2017-10-29T22:08:54Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_changes.png&amp;diff=110921</id>
		<title>File:Before changes.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_changes.png&amp;diff=110921"/>
		<updated>2017-10-29T22:07:57Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110910</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110910"/>
		<updated>2017-10-29T21:33:44Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110909</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110909"/>
		<updated>2017-10-29T21:30:27Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Functionality */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.&lt;br /&gt;
&lt;br /&gt;
*Highlighting next due dates.&lt;br /&gt;
Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110558</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110558"/>
		<updated>2017-10-28T01:30:09Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* E1748. Adding past due assignments to the task list */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
5. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
6. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
7. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
8. The new assignment will be in the Past Due assignment section.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://rubyonrails.org/ The Ruby on Rails website]&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110553</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110553"/>
		<updated>2017-10-28T01:23:55Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_TOC_&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
====Functionality====&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
====Drawbacks and solutions====&lt;br /&gt;
&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
4. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
5. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110551</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110551"/>
		<updated>2017-10-28T01:21:16Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* E1748. Adding past due assignments to the task list */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
_TOC_&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
4. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
5. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110549</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110549"/>
		<updated>2017-10-28T01:20:47Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1748. Adding past due assignments to the task list==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project for Fall 2017. &lt;br /&gt;
&lt;br /&gt;
_TOC_&lt;br /&gt;
&lt;br /&gt;
'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
4. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
5. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110546</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110546"/>
		<updated>2017-10-28T01:19:26Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a  date and time few minutes from the current date and time. &lt;br /&gt;
&lt;br /&gt;
4. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
5. Logout from Expertiza.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list after the due date for the assignment has passed.&lt;br /&gt;
&lt;br /&gt;
7. The new assignment will be in the Past Due assignment section.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110542</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110542"/>
		<updated>2017-10-28T01:16:10Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: /* Testing from UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
&lt;br /&gt;
TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password)&lt;br /&gt;
&lt;br /&gt;
Following are a few test cases with respect to our code changes that can be tried from UI:&lt;br /&gt;
&lt;br /&gt;
1. Login as student and check if past due assignments section is present on the task list. &lt;br /&gt;
&lt;br /&gt;
2. If no such section is present, the student does not have any past due assignments.&lt;br /&gt;
&lt;br /&gt;
3. Log in as an instructor and create a new assignment. &lt;br /&gt;
&lt;br /&gt;
4. Set the deadline for the assignment to a past date. &lt;br /&gt;
&lt;br /&gt;
4. Assign the student being tested as a participant to the created assignment.&lt;br /&gt;
&lt;br /&gt;
5. Logout from expertiza.&lt;br /&gt;
&lt;br /&gt;
6. Login as the student and check the task list to see the new assignment in the Past Due assignment section.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110524</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110524"/>
		<updated>2017-10-28T01:06:20Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;amp;lt;strong&amp;amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;%= @pastdueassignments.size.to_s %&amp;amp;gt;&amp;amp;nbsp;&amp;amp;lt;/span&amp;amp;gt; Past Due Assignments &amp;amp;lt;br&amp;amp;gt;&amp;amp;lt;/strong&amp;amp;gt;&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
    &amp;amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
      	participant = student_task.participant&lt;br /&gt;
      	stage = student_task.current_stage&lt;br /&gt;
      	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
      	duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
      	%&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;span&amp;amp;gt;&amp;amp;nbsp; &amp;amp;raquo; &amp;amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;amp;gt; (&amp;amp;lt;%= student_task.relative_deadline %&amp;amp;gt; Past Deadline )&lt;br /&gt;
        &amp;amp;lt;/span&amp;amp;gt;&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
  &amp;amp;lt;% end %&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
     @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
TODO: Get proper steps with user name and password&lt;br /&gt;
Following are a few testcases with respect to our code changes that can be tried from UI:&lt;br /&gt;
1. Log in as instructor 1 and create a new rubric.&lt;br /&gt;
&lt;br /&gt;
2. Log in as another instructor. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as a student. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as instructor 1. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
4. Re log in as a super administrator / admininstrator. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
5. TODO: Add steps for import/export reuse&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110522</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110522"/>
		<updated>2017-10-28T01:05:12Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
    &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;%= @pastdueassignments.size.to_s %&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;Past Due Assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
          participant = student_task.participant&lt;br /&gt;
          stage = student_task.current_stage&lt;br /&gt;
          topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
          duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
          %&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;&amp;amp;nbsp; &amp;amp;raquo;&lt;br /&gt;
              &amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;gt;&lt;br /&gt;
              (&amp;lt;%= student_task.relative_deadline %&amp;gt; Past Deadline )&lt;br /&gt;
            &amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
      student_task controller.rb&lt;br /&gt;
          @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
TODO: Get proper steps with user name and password&lt;br /&gt;
Following are a few testcases with respect to our code changes that can be tried from UI:&lt;br /&gt;
1. Log in as student.&lt;br /&gt;
&lt;br /&gt;
2. Check the task list. There should be extra past due assignment section.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as a student. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as instructor 1. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
4. Re log in as a super administrator / admininstrator. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
5. TODO: Add steps for import/export reuse&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110517</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110517"/>
		<updated>2017-10-28T00:58:53Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
    &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;%= @pastdueassignments.size.to_s %&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;Past Due Assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
          participant = student_task.participant&lt;br /&gt;
          stage = student_task.current_stage&lt;br /&gt;
          topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
          duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
          %&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;&amp;amp;nbsp; &amp;amp;raquo;&lt;br /&gt;
              &amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;gt;&lt;br /&gt;
              (&amp;lt;%= student_task.relative_deadline %&amp;gt; Past Deadline )&lt;br /&gt;
            &amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
      student_task controller.rb&lt;br /&gt;
          @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;br /&gt;
* To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.&lt;br /&gt;
    &amp;lt;% r=255 %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @tasknotstarted.size &amp;gt; 0 %&amp;gt;&lt;br /&gt;
      &amp;lt;% step = (255/ @tasknotstarted.size).floor %&amp;gt;&lt;br /&gt;
    &amp;lt;%end %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage, {:controller =&amp;gt; controller, :action =&amp;gt; action, :id =&amp;gt; participant.id},&lt;br /&gt;
         {:style=&amp;gt; &amp;quot;color: rgb(&amp;quot; + r.to_s + &amp;quot;,0,0);&amp;quot; } %&amp;gt;&lt;br /&gt;
         (&amp;lt;%= student_task.relative_deadline %&amp;gt; left)&lt;br /&gt;
        &amp;lt;% r= r-step %&amp;gt;&lt;br /&gt;
The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
TODO: Get proper steps with user name and password&lt;br /&gt;
Following are a few testcases with respect to our code changes that can be tried from UI:&lt;br /&gt;
1. Log in as instructor 1 and create a new rubric.&lt;br /&gt;
&lt;br /&gt;
2. Log in as another instructor. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as a student. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
3. Re log in as instructor 1. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
4. Re log in as a super administrator / admininstrator. Go to [ Edit] page for the rubric and try to edit the questions.&lt;br /&gt;
&lt;br /&gt;
5. TODO: Add steps for import/export reuse&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110500</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110500"/>
		<updated>2017-10-28T00:50:54Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
    &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;%= @pastdueassignments.size.to_s %&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;Past Due Assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
          participant = student_task.participant&lt;br /&gt;
          stage = student_task.current_stage&lt;br /&gt;
          topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
          duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
          %&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;&amp;amp;nbsp; &amp;amp;raquo;&lt;br /&gt;
              &amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;gt;&lt;br /&gt;
              (&amp;lt;%= student_task.relative_deadline %&amp;gt; Past Deadline )&lt;br /&gt;
            &amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;br /&gt;
      student_task controller.rb&lt;br /&gt;
          @pastdueassignments = @student_tasks.select(&amp;amp;:overdue_tasks?)&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110499</id>
		<title>CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1748_Add_past-due_assignments_to_task_list&amp;diff=110499"/>
		<updated>2017-10-28T00:48:02Z</updated>

		<summary type="html">&lt;p&gt;Uagrawa: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''About Expertiza'''&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.ncsu.edu/ Expertiza] is an open source project. It is based on [http://rubyonrails.org/ Ruby on Rails] framework. The expertiza project is supported by National Science Foundation.  Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
 &lt;br /&gt;
The following tasks were required to be completed in this project:&lt;br /&gt;
*Issue #80: Add past-due assignments to task list. &lt;br /&gt;
*Highlight with specific colors current and next due dates. &lt;br /&gt;
&lt;br /&gt;
'''Current Implementation'''&lt;br /&gt;
&lt;br /&gt;
Functionality&lt;br /&gt;
&lt;br /&gt;
* Past Due assignments are not present in the task list.&lt;br /&gt;
The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.&lt;br /&gt;
*Next due date.&lt;br /&gt;
Currently it is difficult to distinguish between the assignments which have the next immediate due date.&lt;br /&gt;
&lt;br /&gt;
'''Drawbacks and solutions'''&lt;br /&gt;
* '''Problem1''':  If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''New Implementation''' &lt;br /&gt;
*The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with  current stage set as finished and which were not started by the student.&lt;br /&gt;
    def overdue_task?&lt;br /&gt;
        current_stage == &amp;amp;#39;Finished&amp;amp;#39; &amp;amp;amp;&amp;amp;amp; !started?&lt;br /&gt;
    end&lt;br /&gt;
*In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.&lt;br /&gt;
    &amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;span class=&amp;quot;tasknum&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;%= @pastdueassignments.size.to_s %&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;Past Due Assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
    &amp;lt;% @pastdueassignments.each do |student_task|&lt;br /&gt;
          participant = student_task.participant&lt;br /&gt;
          stage = student_task.current_stage&lt;br /&gt;
          topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)&lt;br /&gt;
          duedate = participant.assignment.stage_deadline(topic_id)&lt;br /&gt;
          %&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;&amp;amp;nbsp; &amp;amp;raquo;&lt;br /&gt;
              &amp;lt;%= student_task.assignment.name + &amp;quot; &amp;quot; + student_task.current_stage %&amp;gt;&lt;br /&gt;
              (&amp;lt;%= student_task.relative_deadline %&amp;gt; Past Deadline )&lt;br /&gt;
            &amp;lt;/span&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
*The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.&lt;/div&gt;</summary>
		<author><name>Uagrawa</name></author>
	</entry>
</feed>