<?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=Zmathew</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=Zmathew"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Zmathew"/>
	<updated>2026-06-06T01:54:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121507</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121507"/>
		<updated>2018-12-11T20:43:18Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were some issues related to the assignment creation. The main motive behind this project is to fix these issues and provide improved functionalities.&lt;br /&gt;
&lt;br /&gt;
There are in all 5 issues that are being dealt within this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented: &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                &amp;lt;span style=background:lightgreen&amp;gt;(@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))&amp;lt;/span&amp;gt; %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to delete any assignment that shows up in the list without the need for matching the assignment Id with it's own and giving Instructor the ability to delete any assignment created by a TA.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:E1863-Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. &lt;br /&gt;
&lt;br /&gt;
The code at present checks for the current user and allows it the permission to delete the file if it's id matches with the Id of assignment creator. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=background:yellow&amp;gt;if id != @assignment_form.assignment.instructor_id&amp;lt;/span&amp;gt;&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&amp;lt;/span&amp;gt;&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment that is created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option if they '''did not create that assignment'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The issue as such did not require modifying the controller spec file for assignments, since the changes were only made to the delete function and the test cases written check for the display of proper flash message that could be mapped for the modified code functionality. Only '''manual testing''' was performed to determine '''successful deletion''' by '''instructor'''.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would reuse the existing automation tests.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;&amp;lt;span style=background:yellow&amp;gt;#user_list&amp;lt;/span&amp;gt;&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;lt;span style=background:lightgreen&amp;gt;user_list&amp;lt;/span&amp;gt;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following test was added to '''assignment_form_spec.rb''' to test if there is an error if the sum of weights of the rubrics do not add up to 0 or 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'when both save and update_attributes method do not work with wrong rubrics weights' do&lt;br /&gt;
        it 'changes @has_errors value to true and returns nil' do&lt;br /&gt;
          allow(assignment_questionnaire).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:update_attributes).with(assignment_questionnaire2).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:[]).with(:questionnaire_weight).and_return(12)&lt;br /&gt;
          expect(assignment_form.update_assignment_questionnaires(attributes)).to eq(nil)&lt;br /&gt;
          expect(assignment_form.instance_variable_get(:@has_errors)).to be true&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=3RKdJe1lxS0 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121442</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121442"/>
		<updated>2018-12-10T04:38:06Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would reuse the existing automation tests.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;&amp;lt;span style=background:yellow&amp;gt;#user_list&amp;lt;/span&amp;gt;&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;lt;span style=background:lightgreen&amp;gt;user_list&amp;lt;/span&amp;gt;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following test was added to '''assignment_form_spec.rb''' to test if there is an error if the sum of weights of the rubrics do not add up to 0 or 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'when both save and update_attributes method do not work with wrong rubrics weights' do&lt;br /&gt;
        it 'changes @has_errors value to true and returns nil' do&lt;br /&gt;
          allow(assignment_questionnaire).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:update_attributes).with(assignment_questionnaire2).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:[]).with(:questionnaire_weight).and_return(12)&lt;br /&gt;
          expect(assignment_form.update_assignment_questionnaires(attributes)).to eq(nil)&lt;br /&gt;
          expect(assignment_form.instance_variable_get(:@has_errors)).to be true&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=3RKdJe1lxS0 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121441</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121441"/>
		<updated>2018-12-10T04:26:41Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would reuse the existing automation tests.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$&amp;lt;b&amp;gt;(&amp;quot;#user_list&amp;quot;)&amp;lt;/b&amp;gt;.append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;user_list&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following test was added to '''assignment_form_spec.rb''' to test if there is an error if the sum of weights of the rubrics do not add up to 0 or 100.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'when both save and update_attributes method do not work with wrong rubrics weights' do&lt;br /&gt;
        it 'changes @has_errors value to true and returns nil' do&lt;br /&gt;
          allow(assignment_questionnaire).to receive(:save).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:update_attributes).with(assignment_questionnaire2).and_return(true)&lt;br /&gt;
          allow(assignment_questionnaire2).to receive(:[]).with(:questionnaire_weight).and_return(12)&lt;br /&gt;
          expect(assignment_form.update_assignment_questionnaires(attributes)).to eq(nil)&lt;br /&gt;
          expect(assignment_form.instance_variable_get(:@has_errors)).to be true&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=3RKdJe1lxS0 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121440</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121440"/>
		<updated>2018-12-10T04:23:17Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would reuse the existing automation tests.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$&amp;lt;b&amp;gt;(&amp;quot;#user_list&amp;quot;)&amp;lt;/b&amp;gt;.append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;user_list&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=3RKdJe1lxS0 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121439</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121439"/>
		<updated>2018-12-10T04:21:40Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$&amp;lt;b&amp;gt;(&amp;quot;#user_list&amp;quot;)&amp;lt;/b&amp;gt;.append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;user_list&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=3RKdJe1lxS0 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121438</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121438"/>
		<updated>2018-12-10T04:21:19Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignments are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below.&lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No automated test cases, only manual testing since the modifications are made to the view files. &lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://youtu.be/G9rWkcBSPnU Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1320 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=-3PTZjRLN-o&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=io89e3xlRPA Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$&amp;lt;b&amp;gt;(&amp;quot;#user_list&amp;quot;)&amp;lt;/b&amp;gt;.append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;user_list&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://www.youtube.com/watch?v=5LImhZ3F_RA&amp;amp;t=2s Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1323 Pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
1. [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Demo Video Link]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121212</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121212"/>
		<updated>2018-12-07T22:29:09Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignemtns are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below. &lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                   &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
                          :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? &amp;amp;&amp;amp; (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
                      &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
                             :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date''' at the bottom.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases would involve setting the topic submission deadline to a date later than the the signup deadline testing the view actions.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if @user.role.name == &amp;quot;Instructor&amp;quot; or (@user.role.name == &amp;quot;Teaching Assistant&amp;quot; and id == @assignment_form.assignment.instructor_id)&lt;br /&gt;
     # allow delete&lt;br /&gt;
     @assignment_form.delete(params[:force])&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
     flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
     # throw error&lt;br /&gt;
     ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
     raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1324 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
The issue was not with the instructor been not able to get added as the participant but it was that the list was not getting updated after adding the participant  and that was due to inconsistent referencing in the view and javascript file. the inconsistent version of both the file is shown as below&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$(&amp;quot;#plist&amp;quot;).append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class = &amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=5 style=&amp;quot;background-color: white; border-top: 0px&amp;quot;&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=3 &amp;gt;E-mail on ...&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=3 &amp;gt;Permissions ...&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;  &lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;% if params[:model] == 'Assignment' and Assignment.find_by(id: params[:id]).has_badge? %&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Badges&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;  &lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submit&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Take quiz&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Handle&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;!--E1721 changes begin--&amp;gt;&lt;br /&gt;
  &amp;lt;% @user_id = [] %&amp;gt;&lt;br /&gt;
  &amp;lt;%= render partial: 'participants/participant', collection: user_list, :locals =&amp;gt; {:userid =&amp;gt; @user_id, :controller =&amp;gt; 'participants'}%&amp;gt;&lt;br /&gt;
  &amp;lt;!--E1721 changes End--&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    var participants = &amp;lt;%=@user_id%&amp;gt;;&lt;br /&gt;
    participants.forEach(function(participant){&lt;br /&gt;
        $('#'.concat(participant.toString())).change(function(){&lt;br /&gt;
            $('#button'.concat(participant.toString())).show();&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changed versions are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; add.js.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
&amp;lt;% unless flash[:error] %&amp;gt;&lt;br /&gt;
$&amp;lt;b&amp;gt;(&amp;quot;#user_list&amp;quot;)&amp;lt;/b&amp;gt;.append(&lt;br /&gt;
	&amp;quot;&amp;lt;%= j render :partial =&amp;gt; 'participant', :locals =&amp;gt; {participant: @participant, :userid =&amp;gt; @participant.user_id, :controller =&amp;gt; 'participants'} %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
+$(&amp;quot;#flash_message&amp;quot;).html(&amp;quot;&amp;lt;%= j render partial: &amp;quot;shared/flash_messages&amp;quot; %&amp;gt;&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; _user_list.html.erb file&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div class = &amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table id=&amp;quot;user_list&amp;quot; class=&amp;quot;table table-striped&amp;quot; style=&amp;quot;font-size: 15px&amp;quot;&amp;gt; # here the table id is changed to user_list&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=5 style=&amp;quot;background-color: white; border-top: 0px&amp;quot;&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=3 &amp;gt;E-mail on ...&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th colspan=3 &amp;gt;Permissions ...&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;  &lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;% if params[:model] == 'Assignment' and Assignment.find_by(id: params[:id]).has_badge? %&amp;gt;&lt;br /&gt;
      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Badges&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;  &lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submit&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Take quiz&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Handle&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Action&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;!--E1721 changes begin--&amp;gt;&lt;br /&gt;
  &amp;lt;% @user_id = [] %&amp;gt;&lt;br /&gt;
  &amp;lt;%= render partial: 'participants/participant', collection: user_list, :locals =&amp;gt; {:userid =&amp;gt; @user_id, :controller =&amp;gt; 'participants'}%&amp;gt;&lt;br /&gt;
  &amp;lt;!--E1721 changes End--&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    var participants = &amp;lt;%=@user_id%&amp;gt;;&lt;br /&gt;
    participants.forEach(function(participant){&lt;br /&gt;
        $('#'.concat(participant.toString())).change(function(){&lt;br /&gt;
            $('#button'.concat(participant.toString())).show();&lt;br /&gt;
        });&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1323 pull request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1328 Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121146</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=121146"/>
		<updated>2018-12-07T08:33:55Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: Layout change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Assignment creation can be done in Expertiza by an instructor or a TA for a particular course. It is available from the '''Manage -&amp;gt; Assignments''' drop down on the expertiza site. Two types of assignments can be created - private and public. The various properties of assignemtns are grouped into tabs - General, Topics, Rubrics, Review strategy, Due dates and Other stuff. There were various issues related to saving data in these. The main motive behind this project is to fix these issues and maintain data integrity.&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project and each of them are explained in detail below. &lt;br /&gt;
&lt;br /&gt;
==Issue #1008 - Issue related to staggered deadline==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza with the credentials: instructor6/password (on google chrome)&lt;br /&gt;
# Go to the '''Manage''' -&amp;gt; '''Assignments'''.&lt;br /&gt;
# Click on '''New Public Assignment'''&lt;br /&gt;
# On the new assignment creation page, under the '''General''' tab, give details for '''Assignment name''', '''Course''' (choose CSC 517, Spring 2016) and '''Submission directory'''. &lt;br /&gt;
# Check the '''Staggered deadline assignment?''' checkbox.&lt;br /&gt;
# Click on the '''Rubrics''' tab and give some values for '''Review''' and '''Author Feedback''', if there are any other fields apart from these give values to that too.&lt;br /&gt;
# Click on '''Create''' at the bottom.&lt;br /&gt;
# Now, click on the the '''Topics''' tab and further click on '''New Topic'''.&lt;br /&gt;
# Give suitable values to the fields and click on '''Create'''.&lt;br /&gt;
# Click on the '''Due dates''' tab.&lt;br /&gt;
# Check the '''Use signup deadline''' checkbox and give suitable dates for '''Signup''', '''Round1: Submission''' and '''Round1: Review'''.&lt;br /&gt;
# Go back to the '''Topics''' tab and click on '''Show start/due date at the bottom'''.&lt;br /&gt;
# Change the '''Submission deadline''' date to date later than the date given for '''Signup''' on the '''Due dates''' tab.&lt;br /&gt;
# Click on '''save''' at the bottom.&lt;br /&gt;
# Now, click on the '''Other stuff''' tab and and further click on '''Add participant'''. It will open in a new tab.&lt;br /&gt;
# Click on '''Copy participants from course'''. After it adds the participants, close the tab.&lt;br /&gt;
# Go to '''Manage''' -&amp;gt;  '''Impersonate User'''.&lt;br /&gt;
# Give '''student6360''' for the '''Enter user account''' field and click on '''Impersonate'''.&lt;br /&gt;
# Click on '''Assignments''' and further click on the assignment that was created in the earlier steps.&lt;br /&gt;
# Click on Signup Sheet.&lt;br /&gt;
# You should be able to see a '''green tick mark''' under the Actions header and '''should be able to click on it''' and signup, which means the issue is fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases would involve setting the topic submission deadline to a date later than the the signup deadline testing the view actions.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1017 - Issue related to deleting assignment==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA. When an assignment is created by the instructor or by the TA , the delete option is assigned to self, that is, to the one who created the assignment. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
The flow diagram given below specifies the sequence of events that will aim at resolving the issue related to deleting an assignment :&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if id == @assignment_form.assignment.instructor_id or (@user.role == &amp;quot;Instructor&amp;quot; and @assignment_form.assignment.instructor.name.role == &amp;quot;ta&amp;quot;)&lt;br /&gt;
    # allow instructor to delete assignment&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    #  throw error&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' The instructor has set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select '''New Assignment'''&lt;br /&gt;
# Enter the '''Assignment Name''' and select '''Course'''. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click '''Create'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Task Description:'' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
''Precondition:'' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
''Primary Flow:''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the '''Delete''' option in the action section for an assignment created by the '''TA'''.  &lt;br /&gt;
# If Logged in as '''Instructor or Teaching Assistant''', the assignment gets deleted for that action.&lt;br /&gt;
# Else, the '''current participant''' is shown the '''error''' message that they do not have authorization to execute the delete option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test cases mainly involve controller testing to check the '''assignment created by TA''' and it '''can be deleted by instructor''' through invocation of the '''''delete''''' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1065 - Issue related to rubrics when an assignment is copied==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #1072 - Issue related to instructor's assignment participation==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issues1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Create a new Assignment &lt;br /&gt;
# Click on the add participant button for the assignment created&lt;br /&gt;
# Modify the participant list by adding instructor as a participant&lt;br /&gt;
# Check the list to see the instructor added to the assignment as participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would involve the controller and view testing to see if the instructor is added to the assignment as a participant through the add and list methods that are being invoked with the participant list showing instructor as the participant.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;br /&gt;
&lt;br /&gt;
==Issue #308 - Issue related to questionnaire weight==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
# [https://piazza.com/class/jl1cgvwxl0f1nl?cid=539 Video Link]&lt;br /&gt;
&lt;br /&gt;
# [http://wiki.expertiza.ncsu.edu/index.php/Main_Page Pull Request]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120380</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120380"/>
		<updated>2018-11-20T22:10:32Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be understood through the flow diagram provided below:&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if id == @assignment_form.assignment.instructor_id or (@user.role == &amp;quot;Instructor&amp;quot; and @assignment_form.assignment.instructor.name.role == &amp;quot;ta&amp;quot;)&lt;br /&gt;
    # allow instructor to delete assignment&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    #  throw error&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Following are the test plans for the individual issues:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120379</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120379"/>
		<updated>2018-11-20T22:07:25Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: Added Test Plan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be understood through the flow diagram provided below:&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if id == @assignment_form.assignment.instructor_id or (@user.role == &amp;quot;Instructor&amp;quot; and @assignment_form.assignment.instructor.name.role == &amp;quot;ta&amp;quot;)&lt;br /&gt;
    # allow instructor to delete assignment&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    #  throw error&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
Following are the test plans for the individual issues:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab to see if there are multiple rubrics defined&lt;br /&gt;
# Copy the assignment, if there are multiple rubrics, from the assignments listing screen&lt;br /&gt;
# Access the newly copied assignment&lt;br /&gt;
# Check if the rubrics tab lists down rubrics for all rounds in the original assignment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the rubrics are copied entirely after the invocation of the ''copy_assignment_questionnaire'' method.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Manual Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Log into Expertiza as instructor&lt;br /&gt;
# Access the Assignments listing&lt;br /&gt;
# Access an assignment and go to the 'Rubrics' tab&lt;br /&gt;
# Modify the data in the rubric weights column in such a way that it adds up to a value other than 0 or 100&lt;br /&gt;
# Click save&lt;br /&gt;
# Check to see if there is an error thrown and the rubrics tab is not saved&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Automated Testing&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would mainly involve controller testing to see if the notice is set correctly when the ''update_assignment_questionnaires'' method is invoked with the sum of weights not being 0 or 100.&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120364</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120364"/>
		<updated>2018-11-20T21:21:39Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be understood through the flow diagram provided below:&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if id == @assignment_form.assignment.instructor_id or (@user.role == &amp;quot;Instructor&amp;quot; and @assignment_form.assignment.instructor.name.role == &amp;quot;ta&amp;quot;)&lt;br /&gt;
    # allow instructor to delete assignment&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    #  throw error&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    &amp;lt;span style=background:lightgreen&amp;gt;validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;# checks to see if the sum of weights of all rubrics add up to either 0 or 100%&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;def validate_assignment_questionnaires_weights(attributes)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  total_weight=0&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  attributes.each do |assignment_questionnaire|&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  if total_weight != 0 and total_weight != 100&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;    @has_errors = true&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;  end&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=background:lightgreen&amp;gt;end&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120363</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120363"/>
		<updated>2018-11-20T21:18:04Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be understood through the flow diagram provided below:&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
The fix to resolve the issue involves the delete function in the assignment controller. The code at present checks for the current user and allows it the permission to delete the file. &lt;br /&gt;
&lt;br /&gt;
  if id != @assignment_form.assignment.instructor_id&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
To allow instructor to delete an assignment created by TA, the if-else block is fixed as given: &lt;br /&gt;
&lt;br /&gt;
  if id == @assignment_form.assignment.instructor_id or (@user.role == &amp;quot;Instructor&amp;quot; and @assignment_form.assignment.instructor.name.role == &amp;quot;ta&amp;quot;)&lt;br /&gt;
    # allow instructor to delete assignment&lt;br /&gt;
    @assignment_form.delete(params[:force])&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;Assignment #{@assignment_form.assignment.id} was deleted.&amp;quot;, request)&lt;br /&gt;
    flash[:success] = &amp;quot;The assignment was successfully deleted.&amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
    #  throw error&lt;br /&gt;
    ExpertizaLogger.info LoggerMessage.new(controller_name, session[:user].name, &amp;quot;You are not authorized to delete this assignment.&amp;quot;, request)&lt;br /&gt;
    raise &amp;quot;You are not authorized to delete this assignment.&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
Modifications made to the code check for the form id and allow permission to delete when the id belongs to assignment creator or when the role of the current user is 'Instructor'.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;lt;!----&amp;gt;&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;used_in_round: aq.used_in_round,&amp;lt;/span&amp;gt;&lt;br /&gt;
      &amp;lt;span style=background:lightgreen&amp;gt;dropdown: aq.dropdown&amp;lt;/span&amp;gt;&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  # checks to see if the sum of weights of all rubrics add up to either 0 or 100%&lt;br /&gt;
  def validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    total_weight=0&lt;br /&gt;
    attributes.each do |assignment_questionnaire|&lt;br /&gt;
      total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&lt;br /&gt;
    end&lt;br /&gt;
    if total_weight != 0 and total_weight != 100&lt;br /&gt;
      @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&lt;br /&gt;
      @has_errors = true&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120061</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120061"/>
		<updated>2018-11-14T06:51:03Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A new validation method '''validate_assignment_questionnaires_weights''' called in the '''update_assignment_questionnaires''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # code to save assignment questionnaires&lt;br /&gt;
  def update_assignment_questionnaires(attributes)&lt;br /&gt;
    return false unless attributes&lt;br /&gt;
    validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    @errors = @assignment.errors&lt;br /&gt;
    unless @has_errors&lt;br /&gt;
      existing_aqs = AssignmentQuestionnaire.where(assignment_id: @assignment.id)&lt;br /&gt;
      existing_aqs.each(&amp;amp;:delete)&lt;br /&gt;
      attributes.each do |assignment_questionnaire|&lt;br /&gt;
        if assignment_questionnaire[:id].nil? or assignment_questionnaire[:id].blank?&lt;br /&gt;
          aq = AssignmentQuestionnaire.new(assignment_questionnaire)&lt;br /&gt;
          unless aq.save&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        else&lt;br /&gt;
          aq = AssignmentQuestionnaire.find(assignment_questionnaire[:id])&lt;br /&gt;
          unless aq.update_attributes(assignment_questionnaire)&lt;br /&gt;
            @errors = @assignment.errors.to_s&lt;br /&gt;
            @has_errors = true&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  # checks to see if the sum of weights of all rubrics add up to either 0 or 100%&lt;br /&gt;
  def validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    total_weight=0&lt;br /&gt;
    attributes.each do |assignment_questionnaire|&lt;br /&gt;
      total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&lt;br /&gt;
    end&lt;br /&gt;
    if total_weight != 0 and total_weight != 100&lt;br /&gt;
      @assignment.errors.add(:message,'Total weight of rubrics should add up to either 0 or 100%')&lt;br /&gt;
      @has_errors = true&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120052</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120052"/>
		<updated>2018-11-14T05:03:41Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A validation method like below called in the '''update''' method of '''assignment_form.rb''' would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks to see if the sum of weights of all rubrics add up to either 0 or 100%&lt;br /&gt;
  def validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    total_weight=0&lt;br /&gt;
    attributes.each do |assignment_questionnaire|&lt;br /&gt;
      total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&lt;br /&gt;
    end&lt;br /&gt;
    if total_weight != 0 and total_weight != 100&lt;br /&gt;
      flash[:error] = 'Total weight of rubrics should add up to either 0 or 100%'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120051</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120051"/>
		<updated>2018-11-14T04:58:50Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list by having an additional parameter to classify the creator of that assignment as Teaching Assistant or Instructor, and giving the Instructor the option to delete an assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
A validation method like below would do the checking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # checks to see if the sum of weights of all rubrics add up to either 0 or 100%&lt;br /&gt;
  def validate_assignment_questionnaires_weights(attributes)&lt;br /&gt;
    total_weight=0&lt;br /&gt;
    attributes.each do |assignment_questionnaire|&lt;br /&gt;
      total_weight+=assignment_questionnaire[:questionnaire_weight].to_i&lt;br /&gt;
    end&lt;br /&gt;
    if total_weight != 0 and total_weight != 100&lt;br /&gt;
      flash[:error] = 'Total weight of rubrics should add up to either 0 or 100%'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120049</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120049"/>
		<updated>2018-11-14T04:55:55Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1017 - Issue related to deleting assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
When an assignment is created by a participant, it assigns the delete option to self. This needs to be overridden in that the instructor must be able to view the assignment list categorized by the creator of that assignment, and perform the delete action successfully.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select New Assignment&lt;br /&gt;
# Enter the Assignment Name and select Course. &lt;br /&gt;
# Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
# Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
# Log in to Expertiza&lt;br /&gt;
# Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
# If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
# Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120047</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120047"/>
		<updated>2018-11-14T04:55:08Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1017 - Issue related to deleting assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Teaching Assistant creating an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' Has the instructor set up the page for assignment creation.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
1. Log in to Expertiza&lt;br /&gt;
&lt;br /&gt;
2. Select New Assignment&lt;br /&gt;
&lt;br /&gt;
3. Enter the Assignment Name and select Course. &lt;br /&gt;
&lt;br /&gt;
4. Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
&lt;br /&gt;
5. Click Create&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task Description:''' Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
&lt;br /&gt;
'''Precondition:''' There exists at least one assignment created by TA.&lt;br /&gt;
&lt;br /&gt;
'''Primary Flow:'''&lt;br /&gt;
&lt;br /&gt;
1. Log in to Expertiza&lt;br /&gt;
&lt;br /&gt;
2. Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
&lt;br /&gt;
3. If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
&lt;br /&gt;
4. Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120043</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=120043"/>
		<updated>2018-11-14T04:50:43Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
If there are multiple topics added in an staggered-deadlined assignment and if the deadline of those topics are in future, students are not able to sign up for any of them. Overall assignment due dates are taking precedence, on the Due Dates tab. Due dates for the assignment needs to be changed manually to the due dates for the new topics just added. Students are able to sign up for topics only when all of the assignment due dates are in the future AND the due date for the topic they are choosing is in the future. They should be able to sign up if only the due date for the topic they are choosing is in the future. The overall assignment due dates should be irrelevant. In other words, topic should obey just the topic deadlines and not the assignment deadlines.&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
At present, when the TA creates a new assignment, only he has the ability to delete it. The task at hand is to allow the instructor to delete the assignment that is created by a TA.&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
The Issue is that the Instructor is not able to participate in a given assignment. This issues require a fix so that the instructor can also add himself as a participant in the assignment created .This fix will allow the instructor to perform the same functionality as the other student participants  as reviewing peer assignments , submitting assignment, etc.&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
For staggered deadline assignments, different topics might have different deadlines. So, the deadline for each topic needs to be checked on an individual basis. Deadlines for individual topics are stored in a table called '''due_dates''' with the '''parent_id''' as the identifier of the particular topic in place of the assignment identifier. A logic for getting the due dates of individual topics for staggered deadline assignments is found in the method '''check_topic_due_date_value''' in the module '''SignUpSheetHelper'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
topic_due_date = TopicDueDate.where(parent_id: topic_id, deadline_type_id: deadline_type_id, round:review_round).first rescue nil&lt;br /&gt;
if !topic_due_date.nil?&lt;br /&gt;
   due_date = topic_due_date.due_at&lt;br /&gt;
else&lt;br /&gt;
   due_date = assignment_due_dates[review_round - 1].due_at.to_s&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently, if the signup deadline of the the '''assignment''' is earlier that the '''submission deadline for a topic''', that topic is not available for taking. This is restricted by the following piece of code in '''_all_actions.html.erb'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif (@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
              (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id))) %&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up',&lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fix to be implemented(tentative): &lt;br /&gt;
Change the above piece of code to allow signing up staggered assignment topics bases on the topic deadline and not on the assignment sign up deadline. The prospective change is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% elsif ((@signup_topic_deadline.nil? || (Time.now &amp;lt; @signup_topic_deadline.due_at)) &amp;amp;&amp;amp;&lt;br /&gt;
                (!@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))) ||&lt;br /&gt;
                (@assignment.staggered_deadline? || (Time.now &amp;lt; get_topic_deadline([@assignment.due_dates.find_by(deadline_type_id: 1)], topic.id)))%&amp;gt;&lt;br /&gt;
              &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= link_to image_tag('Check-icon.png', :border =&amp;gt; 0, :title =&amp;gt; 'Signup', :align =&amp;gt; 'middle'), :controller=&amp;gt;'sign_up_sheet', :action=&amp;gt; 'sign_up', &lt;br /&gt;
               :id=&amp;gt;params[:id],:topic_id =&amp;gt; topic.id, :assignment_id =&amp;gt; params[:assignment_id] %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
Task Description: Teaching Assistant creating an assignment&lt;br /&gt;
Precondition: Has the instructor set up the page for assignment creation.&lt;br /&gt;
Primary Flow:&lt;br /&gt;
1. Log in to Expertiza&lt;br /&gt;
2. Select New Assignment&lt;br /&gt;
3. Enter the Assignment Name and select Course. &lt;br /&gt;
4. Check the parameters for the teams, quiz, badges categories etc. &lt;br /&gt;
5. Click Create&lt;br /&gt;
&lt;br /&gt;
Task Description: Instructor or Teaching Assistant deleting an assignment&lt;br /&gt;
Precondition: There exists at least one assignment created by TA.&lt;br /&gt;
Primary Flow:&lt;br /&gt;
1. Log in to Expertiza&lt;br /&gt;
2. Select the Delete option in the action section for an assignment created by the TA.  &lt;br /&gt;
3. If Logged in as Instructor or Teaching Assistant, the assignment gets deleted for that action.&lt;br /&gt;
4. Else, the current participant cannot execute the option.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1017.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
When an assignment is copied, all the rubric data is to be copied over. As the copying over was incomplete, there were issues. This is fixed in the '''copy_assignment_questionnaire''' method of '''assignment_form.rb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
The current code is shown below. We can see that the data (columns) related to the various rounds are not copied over. This needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the fix, the code looks like below. The columns related to the various rounds will be copied over from now on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def self.copy_assignment_questionnaire(old_assign, new_assign, user)&lt;br /&gt;
  old_assign.assignment_questionnaires.each do |aq|&lt;br /&gt;
    AssignmentQuestionnaire.create(&lt;br /&gt;
      assignment_id: new_assign.id,&lt;br /&gt;
      questionnaire_id: aq.questionnaire_id,&lt;br /&gt;
      user_id: user.id,&lt;br /&gt;
      notification_limit: aq.notification_limit,&lt;br /&gt;
      questionnaire_weight: aq.questionnaire_weight,&lt;br /&gt;
      used_in_round: aq.used_in_round,&lt;br /&gt;
      dropdown: aq.dropdown&lt;br /&gt;
    )&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
Log in as a Instructor. When the instructor is logged in he can create a new assignment or use an existing assignment . All the assignments that are created would require participants which happens to be the responsibility of the instructor . Thus the Instructor adds the participants to the assignment and with this fix the instructor will be added as a participant by default every time a new assignment is created.The new functionality in the assignment controller will be modified to resolve the issue. &lt;br /&gt;
&lt;br /&gt;
[[File:Issue1072.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119622</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119622"/>
		<updated>2018-11-13T05:53:22Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
When we save a new/existing assignment, we need to bring in a check to see if the sum of the weights of the various rubrics add up to 0 or 100%. If this check fails, we need to throw a notice that says, &amp;quot;Sum of weights of rubrics need to be 0 or 100%.&amp;quot;. The user has to make the corresponding modification to the weights and try again. If the check succeeds, we continue with the assignment saving process.&lt;br /&gt;
&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119614</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119614"/>
		<updated>2018-11-13T05:37:22Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: Proposed Solution&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
[[File:Issue1065flowchart.png]]&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
[[File:Issue308Flowchart.png]]&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue1065flowchart.png&amp;diff=119608</id>
		<title>File:Issue1065flowchart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue1065flowchart.png&amp;diff=119608"/>
		<updated>2018-11-13T05:36:43Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue308Flowchart.png&amp;diff=119603</id>
		<title>File:Issue308Flowchart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue308Flowchart.png&amp;diff=119603"/>
		<updated>2018-11-13T05:31:29Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: uploaded a new version of &amp;amp;quot;File:Issue308Flowchart.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue308Flowchart.png&amp;diff=119602</id>
		<title>File:Issue308Flowchart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Issue308Flowchart.png&amp;diff=119602"/>
		<updated>2018-11-13T05:25:59Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119561</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119561"/>
		<updated>2018-11-13T02:34:43Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #308 - Issue related to questionnaire weight */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;br /&gt;
&lt;br /&gt;
While creating/editing an assignment, one of the configurations is setting up of the rubrics. This is done in the 'Rubrics' tab of the assignment page. While setting up the rubrics, we can assign a weight to each of it, so that the final score will be the weighted sum of the different rubric scores. The default weight of a rubric is always 0%, meaning that it's not counted towards the final score. But if any of the rubric is assigned with a non-zero weight, we need to make sure that the sum of all the weights of the various rubrics add up to 100%. This is not enforced currently, allowing the user to have a total weight which is between 0% and 100%. This needs to be fixed to bring in a hard stop, if the sum of the weights don't add up to 0% or 100%.&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119548</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119548"/>
		<updated>2018-11-13T01:38:42Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each round of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119546</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119546"/>
		<updated>2018-11-13T01:34:21Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* Issue #1065 - Issue related to rubrics when an assignment is copied */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
There are assignments that have rubrics that vary by round, i.e. each rounds of the assignment review will have a different set of rubrics. When such an assignment is copied, there exists a problem where the rubrics from the original assignment are not copied over properly to the new assignment. This new assignment does not have rubrics that vary by round, as in the original assignment, but have the rubric from Round 1 in the original assignment copied over for all rounds. This makes the copying of assignments incomplete and thus, needs to be fixed.&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119544</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119544"/>
		<updated>2018-11-13T01:26:04Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
===Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===Issue #308 - Issue related to questionnaire weight===&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119543</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119543"/>
		<updated>2018-11-13T01:25:35Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
===1. Issue #1008 - Issue related to staggered deadline===&lt;br /&gt;
&lt;br /&gt;
===2. Issue #1017 - Issue related to deleting assignment===&lt;br /&gt;
&lt;br /&gt;
===3. Issue #1065 - Issue related to rubrics when an assignment is copied===&lt;br /&gt;
&lt;br /&gt;
===4. Issue #1072 - Issue related to instructor's assignment participation===&lt;br /&gt;
&lt;br /&gt;
===5. Issue #308 - Issue related to questionnaire weight===&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119542</id>
		<title>E1863 Issues related to assignment creation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1863_Issues_related_to_assignment_creation&amp;diff=119542"/>
		<updated>2018-11-13T01:17:44Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: Created page with &amp;quot;== Introduction == === Background ===  An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignm...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
An instructor or TA can create assignments within a course. There are a lot of configurations that can be made while creating these assignments and there are a few known issues related to this. &lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
&lt;br /&gt;
There are 5 issues that are being dealt with in this project:&lt;br /&gt;
&lt;br /&gt;
'''1. Issue #1008 - Issue related to staggered deadline'''&lt;br /&gt;
&lt;br /&gt;
'''2. Issue #1017 - Issue related to deleting assignment'''&lt;br /&gt;
&lt;br /&gt;
'''3. Issue #1065 - Issue related to rubrics when an assignment is copied'''&lt;br /&gt;
&lt;br /&gt;
'''4. Issue #1072 - Issue related to instructor's assignment participation'''&lt;br /&gt;
&lt;br /&gt;
'''5. Issue #308 - Issue related to questionnaire weight'''&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=119265</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=119265"/>
		<updated>2018-11-10T03:56:08Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view of the user and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[:user] and !session[:user].role.student? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Teaching Assistant',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = Role.find(session[:user].role_id)&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin , teaching assistants and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    create(:role_of_student)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117666</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117666"/>
		<updated>2018-10-30T05:45:23Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view of the user and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[:user] and !session[:user].role.student? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Teaching Assistant',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = Role.find(session[:user].role_id)&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin , teaching assistants and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117665</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117665"/>
		<updated>2018-10-30T05:37:31Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* expertiza/config/role_[admin|super_admin|instructor].yml */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view of the user and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[:user] and !session[:user].role.student? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Teaching Assistant',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = Role.find(session[:user].role_id)&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin , teaching assistants and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117664</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117664"/>
		<updated>2018-10-30T05:34:03Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* expertiza/app/controllers/role_switch_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view of the user and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[:user] and !session[:user].role.student? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Teaching Assistant',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = Role.find(session[:user].role_id)&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117663</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117663"/>
		<updated>2018-10-30T05:33:22Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: /* expertiza/app/views/shared/_navigation.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view of the user and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[:user] and !session[:user].role.student? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
  &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # instructor,admin,superadmin is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = session[:user].role&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117594</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117594"/>
		<updated>2018-10-28T22:31:29Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%  if session[:user] and !session[:user].role.student? and !session[:user].role.ta? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # instructor,admin,superadmin is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = session[:user].role&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The following lines are added to '''spec/features/student_view_spec.rb''' file.&lt;br /&gt;
&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent and 'Open Student View' link is present when an instructor is in default view. Also on clicking the 'Manage...' button the 'Student View' sub-menu item should be listed. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Open Student View')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    click_button &amp;quot;Manage...&amp;quot;&lt;br /&gt;
    expect(page).to have_content('Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Assignments'' is present in the menu in default view and there is an option to ''Close Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' and link ''Close Student View'' are present when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Open Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Close Student View')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117591</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117591"/>
		<updated>2018-10-28T21:57:13Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%  if session[:user] and !session[:user].role.student? and !session[:user].role.ta? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # instructor,admin,superadmin is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = session[:user].role&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/role_[admin|super_admin|instructor].yml ===&lt;br /&gt;
&lt;br /&gt;
A new menu node with the below format is added under 'Manage...' node in the yml configuration files for admin, superadmin and instructor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
73: &amp;amp;25 !ruby/object:Menu::Node&lt;br /&gt;
        content_page_id:&lt;br /&gt;
        controller_action_id: 15&lt;br /&gt;
        id: 73&lt;br /&gt;
        label: Student View&lt;br /&gt;
        name: student_view&lt;br /&gt;
        parent:&lt;br /&gt;
        parent_id: 37&lt;br /&gt;
        site_controller_id: 35&lt;br /&gt;
        url: &amp;quot;/role_switch/open_student_view&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent when an instructor is in default view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117590</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117590"/>
		<updated>2018-10-28T21:50:45Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements on the navigation bar including the menu items.&lt;br /&gt;
&lt;br /&gt;
In order to switch between default view and student view, the following code was added. When in default view, the instructor is presented with a link, ''Open Student View'', to switch to student view and when in student view, the ''Close Student View'' link can be used to switch back to the default view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%  if session[:user] and !session[:user].role.student? and !session[:user].role.ta? %&amp;gt;&lt;br /&gt;
  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Close Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;close_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% else %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to &amp;quot;Open Student View&amp;quot;, {controller: &amp;quot;role_switch&amp;quot;, action: &amp;quot;open_student_view&amp;quot;}, method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== expertiza/app/controllers/role_switch_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new ''role_switch_controller.rb'' file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # instructor,admin,superadmin is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = session[:user].role&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' is absent in the menu in default view and there is an option to ''Open Student View'''''  &lt;br /&gt;
This test case is to check if the menu item ''Assignments'' is absent when an instructor is in default view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117583</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117583"/>
		<updated>2018-10-28T21:14:37Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements in the top-most part of the web page. (i.e Displaying the menu items, the logout button etc.)&lt;br /&gt;
&lt;br /&gt;
In order to switch between '''instructor view''' and '''student view''', the following code was added. When the user is in '''instructor view''', there is a link named &amp;quot;Switch to Student View&amp;quot; to switch to '''student view''' and when the user is in '''student view''', 'here is a link named &amp;quot;Revert to Instructor View&amp;quot; to switch back to the '''instructor view'''.&lt;br /&gt;
 &amp;lt;% if session[:user].role.instructor? %&amp;gt;&lt;br /&gt;
                  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Revert to Instructor View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;revert_to_instructor_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% else %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Switch to Student View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;set_student_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% end %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/instructor_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new role_switch_controller.rb file has been added. This controller contains the actions to open/close student view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class RoleSwitchController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # instructor,admin,superadmin is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    ['Super-Administrator',&lt;br /&gt;
     'Administrator',&lt;br /&gt;
     'Instructor'].include? current_role_name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating menu list&lt;br /&gt;
  def open_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    role = Role.student&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # closes student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after reverting the menu list as per the role&lt;br /&gt;
  def close_student_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    role = session[:user].role&lt;br /&gt;
    session[:menu] = role.cache[:menu]&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the role switch controller's ''open_student_view'' and ''close_student_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :role_switch, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :open_student_view&lt;br /&gt;
      post  :close_student_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
The user needs to log-in as an instructor to view this functionality.&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' and ''Course Evaluation'' are hidden when in instructor view.'''  &lt;br /&gt;
This test case is to check if the menu items ''Assignments'' and ''Course Evaluation'' are hidden when an instructor is in instructor view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/hrshagrwl/expertiza]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117582</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117582"/>
		<updated>2018-10-28T21:01:16Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements in the top-most part of the web page. (i.e Displaying the menu items, the logout button etc.)&lt;br /&gt;
&lt;br /&gt;
In order to switch between '''instructor view''' and '''student view''', the following code was added. When the user is in '''instructor view''', there is a link named &amp;quot;Switch to Student View&amp;quot; to switch to '''student view''' and when the user is in '''student view''', 'here is a link named &amp;quot;Revert to Instructor View&amp;quot; to switch back to the '''instructor view'''.&lt;br /&gt;
 &amp;lt;% if session[:user].role.instructor? %&amp;gt;&lt;br /&gt;
                  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Revert to Instructor View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;revert_to_instructor_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% else %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Switch to Student View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;set_student_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% end %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/instructor_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new instructor_controller.rb file has been added. This controller currently contains the actions to switch to student view and revert back to instructor view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class InstructorController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # only an instructor is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    return true if session[:user].role.instructor?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating hidden_menu_items&lt;br /&gt;
  def set_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_student_view(session)&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # destroys student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after updating hidden_menu_items&lt;br /&gt;
  def revert_to_instructor_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_instructor_view(session)&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the instructor controller's ''set_student_view'' and ''revert_to_instructor_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :instructor, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :set_student_view&lt;br /&gt;
      post  :revert_to_instructor_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
The user needs to log-in as an instructor to view this functionality.&lt;br /&gt;
&lt;br /&gt;
1. Login as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Open Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Close Student View''' below username to come back to default view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' and ''Course Evaluation'' are hidden when in instructor view.'''  &lt;br /&gt;
This test case is to check if the menu items ''Assignments'' and ''Course Evaluation'' are hidden when an instructor is in instructor view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/akshayravichandran/expertiza]]&lt;br /&gt;
# Link to screen cast [[https://youtu.be/lRZT4q7YDLA]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_view.png&amp;diff=117581</id>
		<title>File:Student view.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_view.png&amp;diff=117581"/>
		<updated>2018-10-28T20:56:00Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: uploaded a new version of &amp;amp;quot;File:Student view.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Default_view.png&amp;diff=117580</id>
		<title>File:Default view.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Default_view.png&amp;diff=117580"/>
		<updated>2018-10-28T20:54:41Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: uploaded a new version of &amp;amp;quot;File:Default view.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117579</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117579"/>
		<updated>2018-10-28T20:37:47Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements in the top-most part of the web page. (i.e Displaying the menu items, the logout button etc.)&lt;br /&gt;
&lt;br /&gt;
In order to switch between '''instructor view''' and '''student view''', the following code was added. When the user is in '''instructor view''', there is a link named &amp;quot;Switch to Student View&amp;quot; to switch to '''student view''' and when the user is in '''student view''', 'here is a link named &amp;quot;Revert to Instructor View&amp;quot; to switch back to the '''instructor view'''.&lt;br /&gt;
 &amp;lt;% if session[:user].role.instructor? %&amp;gt;&lt;br /&gt;
                  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Revert to Instructor View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;revert_to_instructor_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% else %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Switch to Student View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;set_student_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% end %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/instructor_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new instructor_controller.rb file has been added. This controller currently contains the actions to switch to student view and revert back to instructor view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class InstructorController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # only an instructor is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    return true if session[:user].role.instructor?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating hidden_menu_items&lt;br /&gt;
  def set_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_student_view(session)&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # destroys student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after updating hidden_menu_items&lt;br /&gt;
  def revert_to_instructor_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_instructor_view(session)&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the instructor controller's ''set_student_view'' and ''revert_to_instructor_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :instructor, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :set_student_view&lt;br /&gt;
      post  :revert_to_instructor_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
The user needs to log-in as an instructor to view this functionality.&lt;br /&gt;
&lt;br /&gt;
1. Log into Expertiza as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Switch to Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:default_view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Revert to Instructor View'''' below username to come back to instructor view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:new_student_view.png]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' and ''Course Evaluation'' are hidden when in instructor view.'''  &lt;br /&gt;
This test case is to check if the menu items ''Assignments'' and ''Course Evaluation'' are hidden when an instructor is in instructor view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/akshayravichandran/expertiza]]&lt;br /&gt;
# Link to screen cast [[https://youtu.be/lRZT4q7YDLA]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_student_view.png&amp;diff=117578</id>
		<title>File:New student view.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_student_view.png&amp;diff=117578"/>
		<updated>2018-10-28T20:36:57Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Default_view.png&amp;diff=117577</id>
		<title>File:Default view.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Default_view.png&amp;diff=117577"/>
		<updated>2018-10-28T20:35:37Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117576</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117576"/>
		<updated>2018-10-28T20:32:27Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
The navigation for an instructor follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Manage...&lt;br /&gt;
** Users&lt;br /&gt;
** Questionnaires&lt;br /&gt;
** Courses&lt;br /&gt;
** ''Assignments''&lt;br /&gt;
** Impersonate User&lt;br /&gt;
** Anonymized View&lt;br /&gt;
* Survey Deployments&lt;br /&gt;
* ''Assignments''&lt;br /&gt;
* Course Evaluation&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
And that for a student follows the below structure.&lt;br /&gt;
* Home&lt;br /&gt;
* Assignments&lt;br /&gt;
* Pending Surveys&lt;br /&gt;
* Profile&lt;br /&gt;
* Contact Us&lt;br /&gt;
&lt;br /&gt;
For an instructor, the menu item 'Assignments' is present in 2 places - in the main menu as 'Assignments' and in the sub-menu as 'Manage.../Assignments' (''italicized'' above). This could potentially be confusing. 'Manage.../Assignments' sub-menu item allows the instructor to create/edit assignments. The menu item 'Assignments' allows an instructor to participate in assignments. This is typically something that the instructor wants to do in a student role and hence there needs to be a '''student view''' for instructors to act as students without impersonating them and thus reducing confusion. The same needs to be implemented for admin and super admin as well.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors so that they can perform student operations without impersonating them. When an instructor logs in, he/she is in the default view with corresponding menu items (with the exception of the 'Assignments' menu item). There should be an option to switch to and revert back from the student view. When in student view, an instructor is presented with the student menu as listed above.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements in the top-most part of the web page. (i.e Displaying the menu items, the logout button etc.)&lt;br /&gt;
&lt;br /&gt;
In order to switch between '''instructor view''' and '''student view''', the following code was added. When the user is in '''instructor view''', there is a link named &amp;quot;Switch to Student View&amp;quot; to switch to '''student view''' and when the user is in '''student view''', 'here is a link named &amp;quot;Revert to Instructor View&amp;quot; to switch back to the '''instructor view'''.&lt;br /&gt;
 &amp;lt;% if session[:user].role.instructor? %&amp;gt;&lt;br /&gt;
                  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Revert to Instructor View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;revert_to_instructor_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% else %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Switch to Student View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;set_student_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% end %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/instructor_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new instructor_controller.rb file has been added. This controller currently contains the actions to switch to student view and revert back to instructor view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class InstructorController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # only an instructor is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    return true if session[:user].role.instructor?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating hidden_menu_items&lt;br /&gt;
  def set_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_student_view(session)&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # destroys student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after updating hidden_menu_items&lt;br /&gt;
  def revert_to_instructor_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_instructor_view(session)&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the instructor controller's ''set_student_view'' and ''revert_to_instructor_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :instructor, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :set_student_view&lt;br /&gt;
      post  :revert_to_instructor_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
The user needs to log-in as an instructor to view this functionality.&lt;br /&gt;
&lt;br /&gt;
1. Log into Expertiza as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Switch to Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Student_View_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Revert to Instructor View'''' below username to come back to instructor view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_View_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' and ''Course Evaluation'' are hidden when in instructor view.'''  &lt;br /&gt;
This test case is to check if the menu items ''Assignments'' and ''Course Evaluation'' are hidden when an instructor is in instructor view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/akshayravichandran/expertiza]]&lt;br /&gt;
# Link to screen cast [[https://youtu.be/lRZT4q7YDLA]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117575</id>
		<title>E1826 Add student view for instructor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1826_Add_student_view_for_instructor&amp;diff=117575"/>
		<updated>2018-10-28T19:03:37Z</updated>

		<summary type="html">&lt;p&gt;Zmathew: Created page with &amp;quot;== Introduction == === Background === [http://expertiza.ncsu.edu/ Expertiza] is a web based open source peer reviewing tool developed and maintained by current and past students ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
=== Background ===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a web based open source peer reviewing tool developed and maintained by current and past students of [https://en.wikipedia.org/wiki/North_Carolina_State_University North Carolina State University], Raleigh. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Currently, when an '''instructor''' logs into Expertiza, he/she sees the following menu items across the top:&lt;br /&gt;
&lt;br /&gt;
''Home	 Manage content   Survey Deployments   Assignments   Course Evaluation   Profile   Contact Us''&lt;br /&gt;
&lt;br /&gt;
And, a student can see the following menu items across the top:&lt;br /&gt;
&lt;br /&gt;
''Home Assignments Pending Surveys Profile Contact Us''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the instructor’s “Manage content” menu, one of the options is “Assignments”.  Having “Assignments” appear in two places is potentially confusing.  “Manage content &amp;gt; Assignments” allows the instructor to edit and create assignments, whereas the “Assignments” menu (that both students and instructors) see allows the instructor to participate in assignments.&lt;br /&gt;
&lt;br /&gt;
Therefore, it makes sense to create a '''student view''' for instructors, which will enable them to see menu items that are only related to students. This will help resolve the confusion.&lt;br /&gt;
&lt;br /&gt;
=== Problem statement ===&lt;br /&gt;
Create a '''student view''' for instructors. When in '''student view''', an instructor must not be able to view ''&amp;quot;Manage content&amp;quot;'' and ''&amp;quot;Survey Deployments&amp;quot;'' menu items, and must be able to switch back to the '''instructor view''' (the default view that an instructor first sees when he/she logs in). When in '''instructor view''', an instructor must not be able to view the ''&amp;quot;Assignment&amp;quot;'' and ''&amp;quot;Course Evaluation&amp;quot;'' menu items.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
=== expertiza/app/views/shared/_navigation.html.erb ===&lt;br /&gt;
This file is shared between all views and is responsible for rendering all the elements in the top-most part of the web page. (i.e Displaying the menu items, the logout button etc.)&lt;br /&gt;
&lt;br /&gt;
In order to switch between '''instructor view''' and '''student view''', the following code was added. When the user is in '''instructor view''', there is a link named &amp;quot;Switch to Student View&amp;quot; to switch to '''student view''' and when the user is in '''student view''', 'here is a link named &amp;quot;Revert to Instructor View&amp;quot; to switch back to the '''instructor view'''.&lt;br /&gt;
 &amp;lt;% if session[:user].role.instructor? %&amp;gt;&lt;br /&gt;
                  &amp;lt;% if session.key?(:student_view) %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Revert to Instructor View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;revert_to_instructor_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% else %&amp;gt;&lt;br /&gt;
                      &amp;lt;%= link_to &amp;quot;Switch to Student View&amp;quot;, {controller: &amp;quot;instructor&amp;quot;, action: &amp;quot;set_student_view&amp;quot;},&lt;br /&gt;
                                  method: :post, :style =&amp;gt; &amp;quot;color: white&amp;quot; %&amp;gt;&lt;br /&gt;
                  &amp;lt;% end %&amp;gt;&lt;br /&gt;
              &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/app/controllers/instructor_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
A new instructor_controller.rb file has been added. This controller currently contains the actions to switch to student view and revert back to instructor view.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class InstructorController &amp;lt; ApplicationController&lt;br /&gt;
  # check to see if the current action is allowed&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # only an instructor is allowed to perform all the actions in&lt;br /&gt;
    # this controller&lt;br /&gt;
    return true if session[:user].role.instructor?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # sets student_view in session object and redirects to&lt;br /&gt;
  # student_task/list after updating hidden_menu_items&lt;br /&gt;
  def set_student_view&lt;br /&gt;
    session[:student_view] = true&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_student_view(session)&lt;br /&gt;
    redirect_to controller: 'student_task', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # destroys student_view in session object and redirects to&lt;br /&gt;
  # tree_display/list after updating hidden_menu_items&lt;br /&gt;
  def revert_to_instructor_view&lt;br /&gt;
    session.delete(:student_view)&lt;br /&gt;
    MenuItemsHelper.update_hidden_menu_items_for_instructor_view(session)&lt;br /&gt;
    redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== expertiza/config/routes.rb ===&lt;br /&gt;
&lt;br /&gt;
New post methods are added in ''config/routes.rb''. The routes are directed to the instructor controller's ''set_student_view'' and ''revert_to_instructor_view'' actions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  resources :instructor, only: [] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post  :set_student_view&lt;br /&gt;
      post  :revert_to_instructor_view&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Manual UI Testing ==&lt;br /&gt;
&lt;br /&gt;
The user needs to log-in as an instructor to view this functionality.&lt;br /&gt;
&lt;br /&gt;
1. Log into Expertiza as an instructor. Enter 'instructor6' as username and 'password' as password.&lt;br /&gt;
&lt;br /&gt;
2. Click on '''Switch to Student View''' below username to switch to student view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Student_View_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Click on '''Revert to Instructor View'''' below username to come back to instructor view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_View_1.PNG]]&lt;br /&gt;
&lt;br /&gt;
== Automated Test Plan ==&lt;br /&gt;
1. '''Check whether ''Assignments'' and ''Course Evaluation'' are hidden when in instructor view.'''  &lt;br /&gt;
This test case is to check if the menu items ''Assignments'' and ''Course Evaluation'' are hidden when an instructor is in instructor view. The following lines can be added to a spec/features file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot; can display relevant menu items after login as an admin/instructor/TA&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    expect(page).to have_current_path('/tree_display/list')&lt;br /&gt;
    expect(page).to have_content('Manage content')&lt;br /&gt;
    expect(page).to have_content('Survey Deployments')&lt;br /&gt;
    expect(page).not_to have_content('Assignments')&lt;br /&gt;
    expect(page).not_to have_content('Course Evaluation')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. '''Check whether ''Manage content'' and ''Survey Deployments'' are hidden in student view.'''&lt;br /&gt;
This test case is to check if the menu items ''Manage content'' and ''Survey Deployments'' are hidden when the instructor switches to student view. The following lines are to be added:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it &amp;quot;can display relevant menu items when switching to student view&amp;quot;, js: true do&lt;br /&gt;
    create(:instructor)&lt;br /&gt;
    login_as 'instructor6'&lt;br /&gt;
    visit '/tree_display/list'&lt;br /&gt;
    click_link 'Swtich to Student View'&lt;br /&gt;
    expect(page).to have_current_path('/student_task/list')&lt;br /&gt;
    expect(page).to have_content('Assignments')&lt;br /&gt;
    expect(page).to have_content('Course Evaluation')&lt;br /&gt;
    expect(page).not_to have_content('Manage content')&lt;br /&gt;
    expect(page).not_to have_content('Survey Deployments')&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
# Link to forked repository [[https://github.com/akshayravichandran/expertiza]]&lt;br /&gt;
# Link to screen cast [[https://youtu.be/lRZT4q7YDLA]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
RSpec Documentation&lt;br /&gt;
* http://rspec.info/documentation/&lt;/div&gt;</summary>
		<author><name>Zmathew</name></author>
	</entry>
</feed>