<?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=Smurali8</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=Smurali8"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Smurali8"/>
	<updated>2026-07-18T06:27:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=106764</id>
		<title>CSC/ECE 517 Fall 2016 E1678: Review configuration options</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=106764"/>
		<updated>2016-12-11T06:57:50Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* Requirement 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Expertiza is an online system that is used by students to view/submit assignments and review others' work. Expertiza also provides tools to visualize the scores and gauge the improvements made during the course semester. It also facilitates and monitors team projects. It is targeted at educational and non-profit organizations. The project is funded by the National Software Foundation (NSF), NCSU Learning in a Technology-Rich Environment (LITRE) program, the NCSU Faculty Center for Teaching and Learning, the NCSU STEM Initiative, and the Center for Advanced Computing and Communication.&lt;br /&gt;
Expertiza is an open-source project with the source code available as a public repository on GitHub. It is developed using Ruby on Rails and is increasingly becoming robust thanks to the innumerable bugs being fixed by the community. The project has a micro-blog on SourceForge where the developer community report bugs and document updates.&lt;br /&gt;
&lt;br /&gt;
=Task Description=&lt;br /&gt;
==Requirement 1==&lt;br /&gt;
===Problem===&lt;br /&gt;
Expertiza has two kinds of review strategies, as specified in the Review Strategy tab of assignment creation:&lt;br /&gt;
;Auto-selected: Reviews are not preassigned, but when a student comes to do a review, (s)he can select from the reviews that are available at that point.&lt;br /&gt;
;Instructor-selected:&lt;br /&gt;
Instructor decides in advance who reviews whom.Until now, when the strategy is auto-selected, there has been no maximum on the number of reviews a student could select. So students can review as many topics as they want.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Set a maximum on the number of reviews a student can choose with auto-selected reviewing. Implement a maximum, and allow the instructor to set that maximum via a checkbox asking whether there is a maximum, and if the box is checked, a textbox to specify what the maximum number should be.If there is a maximum, and a reviewer has already selected the maximum number of reviews, the button that allows selecting an additional review should be disabled.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This requirement needs changes to the instructor view and student’s review page. These are small changes to the existing code. So we didn’t find any design pattern which can be used as part of requirement.&lt;br /&gt;
;Instructor view changes &lt;br /&gt;
:While creating the assignment, instructor should be able to specify maximum on the number of reviews done by each student. Assignment related configurations are handled by '''edit''' method in the '''assignment_controller'''. This method gathers all the information and calls '''edit''' view to display results. We added checkbox for this selection under '''Review Strategy''' tab of instructor view. If the instructor selects this checkbox, he’ll be prompted to enter the value for the maximum reviews allowed for each student. This threshold value is stored in '''num_reviews''' column of '''Assignment''' table. All these codes are part of '''assignments/edit/review_strategy''' file since it displays all the elements in '''Review strategy''' tab. Controller stores these values in '''assignments''' database. There are no changes to assignments controller. Instructor view looks as shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:R1iview.png |frame|upright=0.5|center|Requirement 1 - Instructor View Changes]]&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by '''list''' method of '''Student_review_controller'''. We added a check in the controller to see if the chosen number of topics exceeds the value set by the instructor. Topic selection will be disabled in '''views/student_review/_set_dynamic_review.html.erb''' file if the selected number of topics exceeds configured maximum value as shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Stview.png |frame|upright=0.5|center|Requirement 1 - Student View Changes]]&lt;br /&gt;
&lt;br /&gt;
==Requirement 2==&lt;br /&gt;
===Problem===&lt;br /&gt;
Current behaviour of expertiza doesn’t allow the students to drop the reviews. If the student selects some topic and want to drop for some reason, he/she need to contact instructor to drop that review.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Allow students to drop reviews.  When a student has selected a review, there should be a button allowing the student to drop the review. But student should only be able drop a review if the review has not already been submitted.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. '''List.html.erb''' file calls '''/views/student_review/_responses.html.erb''' partial to display already selected topics. Add a delete symbol to the review topics if the assignment stage is not  '''“finished”''' and review is '''“not submitted”'''. &lt;br /&gt;
&lt;br /&gt;
[[File:Drop.png |frame|upright=0.5|center|Requirement 2 - Allow students to drop reviews]]&lt;br /&gt;
[[File:Drop1.png |frame|upright=0.5|center|Requirement 2 - Allow students to drop reviews only if Review has not been submitted.]]&lt;br /&gt;
&lt;br /&gt;
;Student_review_controller changes:&lt;br /&gt;
:Add destroy method to student_review controller. This method should track down the corresponding response map for the topic that needs to be dropped and then delete it.&lt;br /&gt;
&lt;br /&gt;
==Requirement 3==&lt;br /&gt;
===Problem===&lt;br /&gt;
While creating the assignments instructor can allow students to see their teammate score by selecting '''Show teammate reviews?''' checkbox. But this option shows both the scores and teammate reviews on the '''grades/view_my_score''' page.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Instructor should get finer level control to specify these options like '''show only teammate reviews and not scores''', '''show only teammate scores but not reviews''', '''Don’t show anything'''&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
There is already existing code to display and hide the teammate reviews. This requirement doesn’t need any design patterns since we need to modify small portion of the existing code.&lt;br /&gt;
;Instructor view changes&lt;br /&gt;
:General tab of assignment creation has '''&amp;quot;show teammate reviews ?&amp;quot;''' option. We replaced this option with two options. '''&amp;quot;show teammate scores ?&amp;quot;''' , '''&amp;quot;show teammate reviews?&amp;quot;'''. '''&amp;quot;Show teammate reviews ?&amp;quot;''' checkbox value is stored in '''show_teammate_reviews''' column in the '''Assignments''' table. We added one more boolean column '''show_teammate_score''' to hold the selection value of '''&amp;quot;show teammate scores ?&amp;quot;''' option. This is how instructor view will change after implementation.&lt;br /&gt;
[[File:Iview.png |frame|upright=0.5|center|Requirement 3 - Instructor View Changes]]&lt;br /&gt;
&lt;br /&gt;
;Changes to students view score page:&lt;br /&gt;
:Code to display teammate reviews and scores is present in the '''/views/grades/view_my_scores''' file. We added a code to selectively display scores and reviews based on the boolean variables ( show_teammate_reviews, show_teammate_score) present in the Assignments database table. If the instructor only selects '''show teammate scores?''' student will be able to see aggregate teammate score as shown below.&lt;br /&gt;
[[File:Sscore.png |frame|upright=0.5|center|Requirement 3 - Show aggregate teammate scores]]&lt;br /&gt;
Students will be able to see only reviews if the instructor selects '''show teammate reviews ?''' during assignment creation.&lt;br /&gt;
[[File:Rstudent.png |frame|upright=0.5|center|Requirement 3 -Show only teammate reviews]]&lt;br /&gt;
Students will be able to see both the score and teammate reviews if the instructors checks both boxes from assignment configuration page.&lt;br /&gt;
&lt;br /&gt;
==Requirement 4==&lt;br /&gt;
===Problem===&lt;br /&gt;
There is no option that lets reviewers see others’ reviews of the same work after they submit their review of that work.  &lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Implement an option that lets reviewers see others’ reviews of the same work, after they submit their review of that work.  This could help reviewers learn from other reviewers of the same work.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This option should be specified in a reasonable way on the Create Assignment page. So we didn’t find any design pattern which can be used as part of requirement 4, but we re-used code that displays reviews submitted by student for a chosen topic.&lt;br /&gt;
&lt;br /&gt;
;Instructor view changes:&lt;br /&gt;
:While creating the assignment, instructor should be able to specify if students should be allowed to see reviews done by other students for the same work. Assignment related configurations are handled by '''edit''' method in the '''assignment_controllers'''. This method gathers all the information and calls '''edit''' view to display results.We are planning to add checkbox '''show_other_reviews''' for this selection under '''General''' tab of instructor view. If the instructor selects this checkbox, this feature will be active for the assignment. The checkbox will be added in the &amp;quot;assignments/edit/_general&amp;quot; file since It displays all the elements in '''General''' tab.  '''show_other_reviews'''  will be a hidden form field that stores the value of this checkbox that is finally persisted  in '''assignments''' database.&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor review others.png |frame|upright=0.5|center|Requirement 4 - Instructor view to allow students to review others work]]&lt;br /&gt;
&lt;br /&gt;
;Changes to student_response controller and views:&lt;br /&gt;
:The ''View'' link displays  the submitted/in progress reviews  of the student and  is handled by the list action of the StudentReviewController (student_review_controller.rb) and the associated list view is &amp;quot;/views/student_review/list.html.erb&amp;quot; file. We plan to add another link ''Other Reviews'' to the partial '''_reponses''' view. This link would be visible only if the  '''show_other_reviews''' option has been enabled by the instructor and the review for the topic has been submitted by the student. This link would be next to each of the Review Topics submitted by the student of that assignment. Clicking this link would be handled by  an action '''other_reviews''' of the '''reponse_controller'''(response_controller.rb). After fetching some necessary query parameters the action method would filter responses submitted by other students  for that topic and all rounds, exclude the response of the logged in student and set some instance variables. These instance variables would be displayed in the new view '''other_reviews''' in (views/response/other_reviews.erb).&lt;br /&gt;
&lt;br /&gt;
[[File:View other reviews.png |frame|upright=0.5|center|Requirement 4 - Student view - link to view other submitted reviews]]&lt;br /&gt;
&lt;br /&gt;
[[File:Other student responses.png |frame|upright=0.5|center|Requirement 4 - Student view - Reviews submitted by other reviewers for the same work]]&lt;br /&gt;
&lt;br /&gt;
==Requirement 5==&lt;br /&gt;
===Problem===&lt;br /&gt;
The existing implementation of expertiza doesn’t provide a student the option to not see review scores or the text feedback. Sometimes a student might just want to see the scores and not the reviews and other times might want to see the reviews and not the scores. The ability to turn off either one is not provided by expertiza.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
When a student signs in there should be an option that allows the students to change the review score settings. The students will be provided with options of choosing either viewing only the review score or viewing only the text feedback or viewing both. &lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Database Changes:&lt;br /&gt;
:In the participants table, we add a new field called reviewsetting which contains details about the student's chosen review setting. If the value is set to 0 then the student can view both scores and feedback, if the value is set to 1 then the student can view only the scores and if the value is set to 2, then the student can view only the feedback. By default, the value is set to 0. &lt;br /&gt;
;Participant Controller Changes:&lt;br /&gt;
:In the participants controller a new method is introduced to handle the change in the reviewsetting value. The controller is in charge of updating the value in the database based on the option selected by the student. &lt;br /&gt;
;Student View Task page changes:&lt;br /&gt;
:In the student task view, the page where the student can submit work, view scores, review others, etc. we added a new option for the student to change review settings. Clicking on that link takes the student to the change_reviewsettings page where the student can choose to either view both scores and feedback or just scores or feedback. &lt;br /&gt;
;Review page changes:&lt;br /&gt;
:In the partial to view the reviews _review.html.erb, conditions have been added to check the value of the reviewsetting variable. Based on the value of the variable, either both the scores and feedback or just the scores or just the feedback is displayed to the student.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=105228</id>
		<title>CSC/ECE 517 Fall 2016 E1678: Review configuration options</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=105228"/>
		<updated>2016-11-10T02:52:54Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Expertiza is an online system that is used by students to view/submit assignments and review others' work. Expertiza also provides tools to visualize the scores and gauge the improvements made during the course semester. It also facilitates and monitors team projects. It is targeted at educational and non-profit organizations. The project is funded by the National Software Foundation (NSF), NCSU Learning in a Technology-Rich Environment (LITRE) program, the NCSU Faculty Center for Teaching and Learning, the NCSU STEM Initiative, and the Center for Advanced Computing and Communication.&lt;br /&gt;
Expertiza is an open-source project with the source code available as a public repository on GitHub. It is developed using Ruby on Rails and is increasingly becoming robust thanks to the innumerable bugs being fixed by the community. The project has a micro-blog on SourceForge where the developer community report bugs and document updates.&lt;br /&gt;
&lt;br /&gt;
=Task Description=&lt;br /&gt;
==Requirement 1==&lt;br /&gt;
===Problem===&lt;br /&gt;
Expertiza has two kinds of review strategies, as specified in the Review Strategy tab of assignment creation:&lt;br /&gt;
;Auto-selected: Reviews are not preassigned, but when a student comes to do a review, (s)he can select from the reviews that are available at that point.&lt;br /&gt;
;Instructor-selected:&lt;br /&gt;
Instructor decides in advance who reviews whom.Until now, when the strategy is auto-selected, there has been no maximum on the number of reviews a student could select. So students can review as many topics as they want.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Set a maximum on the number of reviews a student can choose with auto-selected reviewing. Implement a maximum, and allow the instructor to set that maximum via a checkbox asking whether there is a maximum, and if the box is checked, a textbox to specify what the maximum number should be.If there is a maximum, and a reviewer has already selected the maximum number of reviews, the button that allows selecting an additional review should be disabled.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This requirement needs changes to the instructor view and student’s review page. These are small changes to the existing code. So we didn’t find any design pattern which can be used as part of requirement.&lt;br /&gt;
;Instructor view changes &lt;br /&gt;
:While creating the assignment, instructor should be able to specify maximum on the number of reviews done by each student. Assignment related configurations are handled by '''edit''' method in the assignment_controllers. This method gathers all the information and calls '''edit''' view to display results. We are planning to add checkbox for this selection under '''Review Strategy''' tab of instructor view. If the instructor selects this checkbox, he’ll be prompted to enter the value for the maximum reviews allowed for each student. We need to fill this value in '''num_reviews''' column of Assignment model. All these codes will be added in '''assignments/edit/review_strategy''' file since it displays all the elements in '''Review strategy''' tab. Controller stores these values in '''assignments''' database. There are no changes assignments controller.&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. Add a check in the controller to see if the chosen number of topics exceeds the value set by the instructor. Disable topic selection in '''views/student_review/_set_dynamic_review.html.erb''' file if the selected number of topics exceeds configured maximum value.&lt;br /&gt;
&lt;br /&gt;
==Requirement 2==&lt;br /&gt;
===Problem===&lt;br /&gt;
Current behaviour of expertiza doesn’t allow the students to drop the reviews. If the student selects some topic and want to drop for some reason, he/she need to contact instructor to drop that review.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Allow students to drop reviews.  When a student has selected a review, there should be a button allowing the student to drop the review. But student should only be able drop a review if the review has not already been submitted.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. '''List.html.erb''' file calls '''/views/student_review/_responses.html.erb''' partial to display already selected topics. Add a delete symbol to the review topics if the assignment stage is not  '''“finished”''' and review is '''“not submitted”'''. &lt;br /&gt;
;Student_review_controller changes:&lt;br /&gt;
:Add destroy method to student_review controller. This method should delete signed up topic for the user/team from '''signed_up_teams''' table. And also it deletes all the non submitted responses from '''response_maps''' table recorded by that team so far.&lt;br /&gt;
&lt;br /&gt;
==Requirement 3==&lt;br /&gt;
===Problem===&lt;br /&gt;
While creating the assignments instructor can allow students to see their teammate score by selecting '''Show teammate reviews?''' checkbox. But this option shows both the scores and teammate reviews on the '''grades/view_my_score''' page.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Instructor should get finer level control to specify these options like '''show only teammate reviews and not scores''', '''show only teammate scores but not reviews''', '''Don’t show anything'''&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
There is already existing code to display and hide the teammate reviews. This requirement doesn’t need any design patterns since we need to modify small portion of the existing code.&lt;br /&gt;
;Instructor view changes&lt;br /&gt;
:General tab of assignment creation has '''&amp;quot;show teammate reviews ?&amp;quot;''' option. Replace this option with two options. '''&amp;quot;show teammate scores ?&amp;quot;''' , '''&amp;quot;show teammate reviews?&amp;quot;'''. '''&amp;quot;Show teammate reviews ?&amp;quot;''' value will be stored in '''show_teammate_reviews''' column in the '''Assignments''' table. We will add one more boolean column '''show_teammate_score''' to hold the selection value of '''&amp;quot;show teammate scores ?&amp;quot;''' option.&lt;br /&gt;
;Changes to students view score page:&lt;br /&gt;
:Code to display teammate reviews and scores is present in the '''/views/grades/view_my_scores''' file. We will add a code to selectively display scores and reviews based on the boolean variables ( show_teammate_reviews, show_teammate_score) present in the Assignments database table&lt;br /&gt;
&lt;br /&gt;
==Requirement 4==&lt;br /&gt;
===Problem===&lt;br /&gt;
There is no option that lets reviewers see others’ reviews of the same work after they submit their review of that work.  &lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Implement an option that lets reviewers see others’ reviews of the same work, after they submit their review of that work.  This could help reviewers learn from other reviewers of the same work.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This option should be specified in a reasonable way on the Create Assignment page. So we didn’t find any design pattern which can be used as part of requirement 4.&lt;br /&gt;
&lt;br /&gt;
;Instructor view changes:&lt;br /&gt;
:While creating the assignment, instructor should be able to specify if students should be allowed to see reviews done by other students for the same work. Assignment related configurations are handled by '''edit''' method in the '''assignment_controllers'''. This method gathers all the information and calls '''edit''' view to display results.We are planning to add checkbox for this selection under '''Review Strategy''' tab of instructor view. If the instructor selects this checkbox, this feature will be active for the assignment.All these codes will be added in &amp;quot;assignments/edit/review_strategy&amp;quot; file since It displays all the elements in '''Review strategy''' tab.  Controller will have an instance variable that stores the value of this checkbox that finally is stored in '''assignments''' database.&lt;br /&gt;
&lt;br /&gt;
;Changes to student_review controller and views:&lt;br /&gt;
:Code that displays the student reviews is handled by the list action of the '''StudentReviewController''' (student_review_controller.rb) and the associated list view is &amp;quot;/views/student_review/list.html.erb&amp;quot; file. The '''@metareview_mappings''' refers to the reviews submitted by the student. We will check if the checkbox is checked for the assignment and if yes, will create another instance variable in the list action of the controller that queries reviews submitted for the same work by other students. We will also add a block of code in the list view that renders this data returned by this instance variable.&lt;br /&gt;
&lt;br /&gt;
==Requirement 5==&lt;br /&gt;
===Problem===&lt;br /&gt;
The existing implementation of expertiza doesn’t provide a student the option to not see review scores or the text feedback. Sometimes a student might just want to see the scores and not the reviews and other times might want to see the reviews and not the scores. The ability to turn off either one is not provided by expertiza.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
When a student signs in there should be an option that allows the students to change the review score settings. The students will be provided with options of choosing either viewing only the review score or viewing only the text feedback or viewing both. &lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Student View Scores page changes:&lt;br /&gt;
:Student review scores is displayed in the View Score page and the /views/grades/view_my_score.html.erb file handles this operation. In this view we plan to provide a dropdown list in which the student can select if he/she wants to view scores only, view feedback only or both. The default setting will be to view both. &lt;br /&gt;
;Grades Controller changes:&lt;br /&gt;
:The view_my_score method in the grades controller performs the task of retrieving the scores and feedback from the database and also does various additional functions like calculating average, etc. In this method, based on the option chosen by the student either only scores or text feedback or both will be retreived. If the student does not explicitly specify any option then both the scores and feedback will be fetched.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=105128</id>
		<title>CSC/ECE 517 Fall 2016 E1678: Review configuration options</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016_E1678:_Review_configuration_options&amp;diff=105128"/>
		<updated>2016-11-10T01:20:55Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
Expertiza is an online system that is used by students to view/submit assignments and review others' work. Expertiza also provides tools to visualize the scores and gauge the improvements made during the course semester. It also facilitates and monitors team projects. It is targeted at educational and non-profit organizations. The project is funded by the National Software Foundation (NSF), NCSU Learning in a Technology-Rich Environment (LITRE) program, the NCSU Faculty Center for Teaching and Learning, the NCSU STEM Initiative, and the Center for Advanced Computing and Communication.&lt;br /&gt;
Expertiza is an open-source project with the source code available as a public repository on GitHub. It is developed using Ruby on Rails and is increasingly becoming robust thanks to the innumerable bugs being fixed by the community. The project has a micro-blog on SourceForge where the developer community report bugs and document updates.&lt;br /&gt;
&lt;br /&gt;
=Task Description=&lt;br /&gt;
==Requirement 1==&lt;br /&gt;
===Problem===&lt;br /&gt;
Expertiza has two kinds of review strategies, as specified in the Review Strategy tab of assignment creation:&lt;br /&gt;
;Auto-selected: Reviews are not preassigned, but when a student comes to do a review, (s)he can select from the reviews that are available at that point.&lt;br /&gt;
;Instructor-selected:&lt;br /&gt;
Instructor decides in advance who reviews whom.Until now, when the strategy is auto-selected, there has been no maximum on the number of reviews a student could select. So students can review as many topics as they want.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Set a maximum on the number of reviews a student can choose with auto-selected reviewing. Implement a maximum, and allow the instructor to set that maximum via a checkbox asking whether there is a maximum, and if the box is checked, a textbox to specify what the maximum number should be.If there is a maximum, and a reviewer has already selected the maximum number of reviews, the button that allows selecting an additional review should be disabled.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This requirement needs changes to the instructor view and student’s review page. These are small changes to the existing code. So we didn’t find any design pattern which can be used as part of requirement.&lt;br /&gt;
;Instructor view changes &lt;br /&gt;
:While creating the assignment, instructor should be able to specify maximum on the number of reviews done by each student. Assignment related configurations are handled by '''edit''' method in the assignment_controllers. This method gathers all the information and calls '''edit''' view to display results. We are planning to add checkbox for this selection under '''Review Strategy''' tab of instructor view. If the instructor selects this checkbox, he’ll be prompted to enter the value for the maximum reviews allowed for each student. We need to fill this value in '''num_reviews''' column of Assignment model. All these codes will be added in '''assignments/edit/review_strategy''' file since it displays all the elements in '''Review strategy''' tab. Controller stores these values in '''assignments''' database. There are no changes assignments controller.&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. Add a check in the controller to see if the chosen number of topics exceeds the value set by the instructor. Disable topic selection in '''views/student_review/_set_dynamic_review.html.erb''' file if the selected number of topics exceeds configured maximum value.&lt;br /&gt;
&lt;br /&gt;
==Requirement 2==&lt;br /&gt;
===Problem===&lt;br /&gt;
Current behaviour of expertiza doesn’t allow the students to drop the reviews. If the student selects some topic and want to drop for some reason, he/she need to contact instructor to drop that review.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Allow students to drop reviews.  When a student has selected a review, there should be a button allowing the student to drop the review. But student should only be able drop a review if the review has not already been submitted.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Student Topic Review page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. '''List.html.erb''' file calls '''/views/student_review/_responses.html.erb''' partial to display already selected topics. Add a delete symbol to the review topics if the assignment stage is not  '''“finished”''' and review is '''“not submitted”'''. &lt;br /&gt;
;Student_review_controller changes:&lt;br /&gt;
:Add destroy method to student_review controller. This method should delete signed up topic for the user/team from '''signed_up_teams''' table. And also it deletes all the non submitted responses from '''response_maps''' table recorded by that team so far.&lt;br /&gt;
&lt;br /&gt;
==Requirement 3==&lt;br /&gt;
===Problem===&lt;br /&gt;
While creating the assignments instructor can allow students to see their teammate score by selecting '''Show teammate reviews?''' checkbox. But this option shows both the scores and teammate reviews on the '''grades/view_my_score''' page.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Instructor should get finer level control to specify these options like '''show only teammate reviews and not scores''', '''show only teammate scores but not reviews''', '''Don’t show anything'''&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
There is already existing code to display and hide the teammate reviews. This requirement doesn’t need any design patterns since we need to modify small portion of the existing code.&lt;br /&gt;
;Instructor view changes&lt;br /&gt;
:General tab of assignment creation has '''&amp;quot;show teammate reviews ?&amp;quot;''' option. Replace this option with two options. '''&amp;quot;show teammate scores ?&amp;quot;''' , '''&amp;quot;show teammate reviews?&amp;quot;'''. '''&amp;quot;Show teammate reviews ?&amp;quot;''' value will be stored in '''show_teammate_reviews''' column in the '''Assignments''' table. We will add one more boolean column '''show_teammate_score''' to hold the selection value of '''&amp;quot;show teammate scores ?&amp;quot;''' option.&lt;br /&gt;
;Changes to students view score page:&lt;br /&gt;
:Code to display teammate reviews and scores is present in the '''/views/grades/view_my_scores''' file. We will add a code to selectively display scores and reviews based on the boolean variables ( show_teammate_reviews, show_teammate_score) present in the Assignments database table&lt;br /&gt;
&lt;br /&gt;
==Requirement 4==&lt;br /&gt;
===Problem===&lt;br /&gt;
There is no option that lets reviewers see others’ reviews of the same work after they submit their review of that work.  &lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
Implement an option that lets reviewers see others’ reviews of the same work, after they submit their review of that work.  This could help reviewers learn from other reviewers of the same work.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
This option should be specified in a reasonable way on the Create Assignment page.&lt;br /&gt;
&lt;br /&gt;
==Requirement 5==&lt;br /&gt;
===Problem===&lt;br /&gt;
The existing implementation of expertiza doesn’t provide a student the option to not see review scores or the text feedback. Sometimes a student might just want to see the scores and not the reviews and other times might want to see the reviews and not the scores. The ability to turn off either one is not provided by expertiza.&lt;br /&gt;
&lt;br /&gt;
===Requirement===&lt;br /&gt;
When a student signs in there should be an option that allows the students to change the review score settings. The students will be provided with options of choosing either viewing only the review score or viewing only the text feedback or viewing both. &lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
;Student View Scores page changes:&lt;br /&gt;
:Students review topics page is displayed by list method of '''Student_review_controller'''. '''List.html.erb''' file calls '''/views/student_review/_responses.html.erb''' partial to display already selected topics. Add a delete symbol to the review topics if the assignment stage is not  '''“finished”''' and review is '''“not submitted”'''. &lt;br /&gt;
;Student_review_controller changes:&lt;br /&gt;
:Add destroy method to student_review controller. This method should delete signed up topic for the user/team from '''signed_up_teams''' table. And also it deletes all the non submitted responses from '''response_maps''' table recorded by that team so far.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104662</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104662"/>
		<updated>2016-11-05T05:58:52Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an educational web application built on [http://rubyonrails.org/ Ruby on Rails] framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module were very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modify the PenaltyHelper to calculate and return the correct penalty value &lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores page to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary RSpec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T2: Refactor the update function in LatePoliciesController ===&lt;br /&gt;
The update function performs the same checks as the create function. The check statements are replaced by the appropriate calls to validate_penalty_unit and validate_duplicate_policy. In addition, when the late policy is updated, the corresponding penalty calculations have to be updated for students enrolled in assignments using the corresponding late policy. So a new function called values_update is introduced which performs the necessary task.&lt;br /&gt;
==== values_update ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def values_update(params)&lt;br /&gt;
    @penaltyObjs = CalculatedPenalty.all&lt;br /&gt;
    @penaltyObjs.each do |pen|&lt;br /&gt;
      @participant = AssignmentParticipant.find(pen.participant_id)&lt;br /&gt;
      @assignment = @participant.assignment&lt;br /&gt;
      next unless @assignment.late_policy_id == @penalty_policy.id&lt;br /&gt;
      @penalties = calculate_penalty(pen.participant_id)&lt;br /&gt;
      @total_penalty = (@penalties[:submission] + @penalties[:review] + @penalties[:meta_review])&lt;br /&gt;
      if pen.deadline_type_id.to_i == 1&lt;br /&gt;
        {penalty_points: @penalties[:submission]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:submission])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 2&lt;br /&gt;
        {penalty_points: @penalties[:review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:review])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 5&lt;br /&gt;
        {penalty_points: @penalties[:meta_review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:meta_review])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T3: Modify the PenaltyHelper ===&lt;br /&gt;
The helper function penalty_helper.rb aides in calculating associated penalties with a late submission. In the original implementation, penalties were not calculated and returned. Minor modifications were made in the penalty_helper.rb file to return the value of calculated penalty. &lt;br /&gt;
=== T4: Modify the GradesController ===&lt;br /&gt;
The controller grades_controller.rb performs all the necessary functions involved with calculating scores. In the original implementation, the calculated penalties were not subtracted from the total score when a late submission was made. This controller is now modified such that based on the time of submission (if late) penalty points would be deducted from the total obtained score. &lt;br /&gt;
=== T5: Modify the ViewScores ===&lt;br /&gt;
When a student clicks on view scores link for an assignment he/she can view the scores obtained for that assignment. In the original implementation, the students could not view the penalty deductions obtained for the assignment. To enable this, additional code was added to /app/views/grades/_participant.html.erb, /app/views/grades/_participant_charts.html.erb and /app/views/grades/_participant_title.html.erb. Now when the student clicks on the view scores link, he/she can see all the penalty deductions in addition to the total score obtained. &lt;br /&gt;
=== T6: Test the working of the LatePolicy model ===&lt;br /&gt;
While creating a late policy many constraints have to be kept in mind like the policy name should not be blank or empty, every late policy should have an instructor associated with it, the maximum penalty and penalty per unit should be a positive number and the penalty unit should always be set (seconds/minutes/hours). We have ensured that these constraints function effectively by writing the necessary rspec tests. The rspec test can be located in /spec/models/late_policy_spec.rb.&lt;br /&gt;
==== late_policy_spec.rb ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rails_helper'&lt;br /&gt;
&lt;br /&gt;
describe 'LatePolicy' do&lt;br /&gt;
  let (:late_policy) {LatePolicy.new policy_name: &amp;quot;Test&amp;quot;, instructor_id: 1234, max_penalty: 20, penalty_per_unit: 2, penalty_unit: &amp;quot;hours&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#policy_name&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the name of late policy&amp;quot; do&lt;br /&gt;
      expect(late_policy.policy_name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validates that the policy_name is not blank&amp;quot; do&lt;br /&gt;
      late_policy.policy_name = ' '&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  describe &amp;quot;#instructor_id&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the instructor id&amp;quot; do&lt;br /&gt;
    expect(late_policy.instructor_id).to eq(1234)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#max_penalty&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the maximum penalty value&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validate max penalty is a number&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = 'a'&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be greater than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = -20&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.max_penalty = 20&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be less than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = 51&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.max_penalty = 20&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#penalty_per_unit&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the penalty per unit value&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validate penalty per unit is a number&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
      late_policy.penalty_per_unit = 'a'&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be greater than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
      late_policy.penalty_per_unit = -2&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.penalty_per_unit = 2&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#penalty_unit&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the penalty unit value&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_unit).to eq(&amp;quot;hours&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validates that the penalty_unit is not blank&amp;quot; do&lt;br /&gt;
      late_policy.penalty_unit = ' '&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
As mentioned earlier, rspec tests are written to test the proper functioning of the LatePolicy model. The rspec tests can be found in /spec/models/late_policy_spec.rb file. &lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code was refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and are visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;br /&gt;
&lt;br /&gt;
=== Link for demo ===&lt;br /&gt;
The demo for testing this functionality can be viewed at https://youtu.be/mOoIKkyu5cA. Please do turn on closed captions while viewing the video to obtain a better understanding. &lt;br /&gt;
&lt;br /&gt;
== Scope for future ==&lt;br /&gt;
While the late penalty has been implemented, there are few aspects of this project that can be improved.&lt;br /&gt;
&lt;br /&gt;
#Currently the review penalty is not being calculated because submission of review is not allowed after the mentioned deadline. If the review for an assignment is submitted after the mentioned deadline no points get deducted even after enabling late review. This will require code changes in assignment and other controllers.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104661</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104661"/>
		<updated>2016-11-05T05:54:28Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module were very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modify the PenaltyHelper to calculate and return the correct penalty value &lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores page to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary RSpec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T2: Refactor the update function in LatePoliciesController ===&lt;br /&gt;
The update function performs the same checks as the create function. The check statements are replaced by the appropriate calls to validate_penalty_unit and validate_duplicate_policy. In addition, when the late policy is updated, the corresponding penalty calculations have to be updated for students enrolled in assignments using the corresponding late policy. So a new function called values_update is introduced which performs the necessary task.&lt;br /&gt;
==== values_update ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def values_update(params)&lt;br /&gt;
    @penaltyObjs = CalculatedPenalty.all&lt;br /&gt;
    @penaltyObjs.each do |pen|&lt;br /&gt;
      @participant = AssignmentParticipant.find(pen.participant_id)&lt;br /&gt;
      @assignment = @participant.assignment&lt;br /&gt;
      next unless @assignment.late_policy_id == @penalty_policy.id&lt;br /&gt;
      @penalties = calculate_penalty(pen.participant_id)&lt;br /&gt;
      @total_penalty = (@penalties[:submission] + @penalties[:review] + @penalties[:meta_review])&lt;br /&gt;
      if pen.deadline_type_id.to_i == 1&lt;br /&gt;
        {penalty_points: @penalties[:submission]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:submission])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 2&lt;br /&gt;
        {penalty_points: @penalties[:review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:review])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 5&lt;br /&gt;
        {penalty_points: @penalties[:meta_review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:meta_review])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T3: Modify the PenaltyHelper ===&lt;br /&gt;
The helper function penalty_helper.rb aides in calculating associated penalties with a late submission. In the original implementation, penalties were not calculated and returned. Minor modifications were made in the penalty_helper.rb file to return the value of calculated penalty. &lt;br /&gt;
=== T4: Modify the GradesController ===&lt;br /&gt;
The controller grades_controller.rb performs all the necessary functions involved with calculating scores. In the original implementation, the calculated penalties were not subtracted from the total score when a late submission was made. This controller is now modified such that based on the time of submission (if late) penalty points would be deducted from the total obtained score. &lt;br /&gt;
=== T5: Modify the ViewScores ===&lt;br /&gt;
When a student clicks on view scores link for an assignment he/she can view the scores obtained for that assignment. In the original implementation, the students could not view the penalty deductions obtained for the assignment. To enable this, additional code was added to /app/views/grades/_participant.html.erb, /app/views/grades/_participant_charts.html.erb and /app/views/grades/_participant_title.html.erb. Now when the student clicks on the view scores link, he/she can see all the penalty deductions in addition to the total score obtained. &lt;br /&gt;
=== T6: Test the working of the LatePolicy model ===&lt;br /&gt;
While creating a late policy many constraints have to be kept in mind like the policy name should not be blank or empty, every late policy should have an instructor associated with it, the maximum penalty and penalty per unit should be a positive number and the penalty unit should always be set (seconds/minutes/hours). We have ensured that these constraints function effectively by writing the necessary rspec tests. The rspec test can be located in /spec/models/late_policy_spec.rb.&lt;br /&gt;
==== late_policy_spec.rb ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'rails_helper'&lt;br /&gt;
&lt;br /&gt;
describe 'LatePolicy' do&lt;br /&gt;
  let (:late_policy) {LatePolicy.new policy_name: &amp;quot;Test&amp;quot;, instructor_id: 1234, max_penalty: 20, penalty_per_unit: 2, penalty_unit: &amp;quot;hours&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#policy_name&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the name of late policy&amp;quot; do&lt;br /&gt;
      expect(late_policy.policy_name).to eq(&amp;quot;Test&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validates that the policy_name is not blank&amp;quot; do&lt;br /&gt;
      late_policy.policy_name = ' '&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  describe &amp;quot;#instructor_id&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the instructor id&amp;quot; do&lt;br /&gt;
    expect(late_policy.instructor_id).to eq(1234)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#max_penalty&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the maximum penalty value&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validate max penalty is a number&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = 'a'&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be greater than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = -20&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.max_penalty = 20&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be less than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.max_penalty).to eq(20)&lt;br /&gt;
      late_policy.max_penalty = 51&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.max_penalty = 20&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#penalty_per_unit&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the penalty per unit value&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validate penalty per unit is a number&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
      late_policy.penalty_per_unit = 'a'&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;should be greater than 0&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_per_unit).to eq(2)&lt;br /&gt;
      late_policy.penalty_per_unit = -2&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
      late_policy.penalty_per_unit = 2&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe &amp;quot;#penalty_unit&amp;quot; do&lt;br /&gt;
    it &amp;quot;returns the penalty unit value&amp;quot; do&lt;br /&gt;
      expect(late_policy.penalty_unit).to eq(&amp;quot;hours&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it &amp;quot;validates that the penalty_unit is not blank&amp;quot; do&lt;br /&gt;
      late_policy.penalty_unit = ' '&lt;br /&gt;
      expect(late_policy).not_to be_valid&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
As mentioned earlier, rspec tests are written to test the proper functioning of the LatePolicy model. The rspec tests can be found in /spec/models/late_policy_spec.rb file. &lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code was refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and are visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;br /&gt;
&lt;br /&gt;
=== Link for demo ===&lt;br /&gt;
The demo for testing this functionality can be viewed at https://youtu.be/mOoIKkyu5cA. Please do turn on closed captions while viewing the video to obtain a better understanding. &lt;br /&gt;
&lt;br /&gt;
== Scope for future ==&lt;br /&gt;
While the late penalty has been implemented, there are few aspects of this project that can be improved.&lt;br /&gt;
&lt;br /&gt;
#Currently the review penalty is not being calculated because submission of review is not allowed after the mentioned deadline. If the review for an assignment is submitted after the mentioned deadline no points get deducted even after enabling late review. This will require code changes in assignment and other controllers.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104653</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104653"/>
		<updated>2016-11-05T05:22:31Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary RSpec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T2: Refactor the update function in LatePoliciesController ===&lt;br /&gt;
The update function performs the same checks as the create function. The check statements are replaced by the appropriate calls to validate_penalty_unit and validate_duplicate_policy. In addition, when the late policy is updated, the corresponding penalty calculations have to be updated for students enrolled in assignments using the corresponding late policy. So a new function called values_update is introduced which performs the necessary task.&lt;br /&gt;
==== values_update ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def values_update(params)&lt;br /&gt;
    @penaltyObjs = CalculatedPenalty.all&lt;br /&gt;
    @penaltyObjs.each do |pen|&lt;br /&gt;
      @participant = AssignmentParticipant.find(pen.participant_id)&lt;br /&gt;
      @assignment = @participant.assignment&lt;br /&gt;
      next unless @assignment.late_policy_id == @penalty_policy.id&lt;br /&gt;
      @penalties = calculate_penalty(pen.participant_id)&lt;br /&gt;
      @total_penalty = (@penalties[:submission] + @penalties[:review] + @penalties[:meta_review])&lt;br /&gt;
      if pen.deadline_type_id.to_i == 1&lt;br /&gt;
        {penalty_points: @penalties[:submission]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:submission])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 2&lt;br /&gt;
        {penalty_points: @penalties[:review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:review])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 5&lt;br /&gt;
        {penalty_points: @penalties[:meta_review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:meta_review])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code was refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and are visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;br /&gt;
&lt;br /&gt;
=== Link for demo ===&lt;br /&gt;
The demo for testing this functionality can be viewd at https://youtu.be/mOoIKkyu5cA. Please do turn on closed captions while viewing the video to obtain a better understanding. &lt;br /&gt;
&lt;br /&gt;
== Scope for future ==&lt;br /&gt;
While the late penalty has been implemented, there are few aspects of this project that can be improved.&lt;br /&gt;
&lt;br /&gt;
#Currently the review penalty is not being calculated because, submission of review is not allowed after deadline. The assignment gets completed after deadline, even though one had selected late review enable. This will require code changes in assignment or other controllers.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104434</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104434"/>
		<updated>2016-11-04T19:53:20Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary RSpec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T2: Refactor the update function in LatePoliciesController ===&lt;br /&gt;
The update function performs the same checks as the create function. The check statements are replaced by the appropriate calls to validate_penalty_unit and validate_duplicate_policy. In addition, when the late policy is updated, the corresponding penalty calculations have to be updated for students enrolled in assignments using the corresponding late policy. So a new function called values_update is introduced which performs the necessary task.&lt;br /&gt;
==== values_update ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def values_update(params)&lt;br /&gt;
    @penaltyObjs = CalculatedPenalty.all&lt;br /&gt;
    @penaltyObjs.each do |pen|&lt;br /&gt;
      @participant = AssignmentParticipant.find(pen.participant_id)&lt;br /&gt;
      @assignment = @participant.assignment&lt;br /&gt;
      next unless @assignment.late_policy_id == @penalty_policy.id&lt;br /&gt;
      @penalties = calculate_penalty(pen.participant_id)&lt;br /&gt;
      @total_penalty = (@penalties[:submission] + @penalties[:review] + @penalties[:meta_review])&lt;br /&gt;
      if pen.deadline_type_id.to_i == 1&lt;br /&gt;
        {penalty_points: @penalties[:submission]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:submission])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 2&lt;br /&gt;
        {penalty_points: @penalties[:review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:review])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 5&lt;br /&gt;
        {penalty_points: @penalties[:meta_review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:meta_review])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code was refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and are visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104411</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104411"/>
		<updated>2016-11-04T19:14:47Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary rspec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== T2: Refactor the update function in LatePoliciesController ===&lt;br /&gt;
The update function performs the same checks as the create function. The check statements are replaced by the appropriate calls to validate_penalty_unit and validate_duplicate_policy. In addition, when the late policy is updated, the corresponding penalty calculations have to be updated for students enrolled in assignments using the corresponding late policy. So a new function called values_update is introduced which performs the necessary task.&lt;br /&gt;
==== values_update ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def values_update(params)&lt;br /&gt;
    @penaltyObjs = CalculatedPenalty.all&lt;br /&gt;
    @penaltyObjs.each do |pen|&lt;br /&gt;
      @participant = AssignmentParticipant.find(pen.participant_id)&lt;br /&gt;
      @assignment = @participant.assignment&lt;br /&gt;
      next unless @assignment.late_policy_id == @penalty_policy.id&lt;br /&gt;
      @penalties = calculate_penalty(pen.participant_id)&lt;br /&gt;
      @total_penalty = (@penalties[:submission] + @penalties[:review] + @penalties[:meta_review])&lt;br /&gt;
      if pen.deadline_type_id.to_i == 1&lt;br /&gt;
        {penalty_points: @penalties[:submission]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:submission])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 2&lt;br /&gt;
        {penalty_points: @penalties[:review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:review])&lt;br /&gt;
      elsif pen.deadline_type_id.to_i == 5&lt;br /&gt;
        {penalty_points: @penalties[:meta_review]}&lt;br /&gt;
        pen.update_attribute(:penalty_points, @penalties[:meta_review])&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104407</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104407"/>
		<updated>2016-11-04T19:07:33Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* validate_duplicate_policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary rspec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    not_duplicate = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return not_duplicate&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    not_duplicate = true&lt;br /&gt;
    not_duplicate&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104397</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104397"/>
		<updated>2016-11-04T18:56:18Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* T1: Refactor create function in LatePoliciesController */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary rspec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle. To overcome this discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==== validate_duplicate_policy ====&lt;br /&gt;
This function checks that another policy with the same name created by a different instructor does not exist. Duplicate policy names are permissable if created by the same instructor. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_duplicate_policy(params)&lt;br /&gt;
    is_number = false&lt;br /&gt;
    @late_policy = LatePolicy.where(policy_name: params[:late_policy][:policy_name])&lt;br /&gt;
    if !@late_policy.nil? &amp;amp;&amp;amp; !@late_policy.empty?&lt;br /&gt;
      @late_policy.each do |p|&lt;br /&gt;
          if p.instructor_id != instructor_id&lt;br /&gt;
            flash[:error] = &amp;quot;A policy with the same name already exists.&amp;quot;&lt;br /&gt;
            return is_number&lt;br /&gt;
          end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    is_number = true&lt;br /&gt;
    is_number&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104396</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104396"/>
		<updated>2016-11-04T18:48:03Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T2: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary rspec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
=== T1: Refactor create function in LatePoliciesController ===&lt;br /&gt;
'''Original Implementation:''' The create function performed various checks on the parameters passed from the form instead of calling appropriate functions to do them. The same checks were performed by the update function. This violated the DRY principle.&lt;br /&gt;
Solution: To overcome the above-mentioned discrepancy, two functions were created namely, validate_penalty_unit and validate_duplicate_policy which perform the required checks. &lt;br /&gt;
==== validate_penalty_unit ====&lt;br /&gt;
This function checks that the penalty per unit is less than the maximum penalty. If this function returns fall, the LatePolicy will not be created. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private def validate_penalty_unit(params)&lt;br /&gt;
    penalty_valid = false&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i &amp;lt; params[:late_policy][:penalty_per_unit].to_i&lt;br /&gt;
      flash[:error] = &amp;quot;The maximum penalty cannot be less than penalty per unit.&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      penalty_valid = true&lt;br /&gt;
    end&lt;br /&gt;
    penalty_valid&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104384</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104384"/>
		<updated>2016-11-04T18:27:42Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== LatePolicyController ====&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
==== GradesController ====&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== Helpers ===&lt;br /&gt;
==== PenaltyHelper ====&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately. The list of views modified are as follows,&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== Rspec Testing ===&lt;br /&gt;
==== LatePolicy Model Testing ====&lt;br /&gt;
Rspec tests were written to test the functionality of the LatePolicy model. The tests ensure that the attributes in the model obtain the correct value. In addition, the tests also ensure that none of the fields are empty and ensures the maximum penalty and penalty per unit is a positive number which lies in a specified range. &lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
*T6: Test the working of the LatePolicy model by writing necessary rspec tests&lt;br /&gt;
&lt;br /&gt;
== Implementation of Tasks ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104001</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104001"/>
		<updated>2016-10-29T22:01:22Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* = Testing LatePoliciesController */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
==== Controllers ====&lt;br /&gt;
*late_policies_controller.rb&lt;br /&gt;
*grades_controller.rb&lt;br /&gt;
==== Helpers ====&lt;br /&gt;
*penalty_helper.rb&lt;br /&gt;
==== Views ====&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
=== GradesController ===&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately.&lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ====&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104000</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=104000"/>
		<updated>2016-10-29T22:00:50Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
==== Controllers ====&lt;br /&gt;
*late_policies_controller.rb&lt;br /&gt;
*grades_controller.rb&lt;br /&gt;
==== Helpers ====&lt;br /&gt;
*penalty_helper.rb&lt;br /&gt;
==== Views ====&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
=== GradesController ===&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately.&lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
==== Testing LatePoliciesController ===&lt;br /&gt;
The create and the update code were refactored and modularized in the LatePoliciesController. The following steps can be followed from the Web UI to ensure that the refactoring did not affect the functionality of LatePoliciesController.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#In the due dates tab in create assignment check the &amp;quot;Apply Late Policy&amp;quot; box&lt;br /&gt;
#Select &amp;quot;New Late Policy&amp;quot; link&lt;br /&gt;
#Fill in the form with necessary details and submit&lt;br /&gt;
#The newly created late policy will be displayed in the list of all late policies&lt;br /&gt;
#Select the &amp;quot;Edit&amp;quot; option for the created late policy&lt;br /&gt;
#Change the required fields and save the changes&lt;br /&gt;
#The updated late policy is displayed in the list of late policies&lt;br /&gt;
#Edit the assignment/create a new assignment&lt;br /&gt;
#In the due dates tab, the newly created late policy will be displayed in the dropdown&lt;br /&gt;
==== Testing Penalty Calculation and Deduction ====&lt;br /&gt;
Changes were made in the Penalty Helper file and Grades Controller to calculate the correct penalty value and deduct it from the total scores obtained. Changes were made in so that the View Scores option would display the penalties in addition to the total score. The following steps can be followed to ensure that the penalties get deducted appropriately from the total score and is visible to the student.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course along with a late policy&lt;br /&gt;
#Create a team of 2-3 students for the created assignment&lt;br /&gt;
#Login as a student&lt;br /&gt;
#Make a submission for the assignment past the mentioned deadline&lt;br /&gt;
#Go to view scores and the deducted penalty will be displayed&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103999</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103999"/>
		<updated>2016-10-29T21:36:13Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* List of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
==== Controllers ====&lt;br /&gt;
*late_policies_controller.rb&lt;br /&gt;
*grades_controller.rb&lt;br /&gt;
==== Helpers ====&lt;br /&gt;
*penalty_helper.rb&lt;br /&gt;
==== Views ====&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
=== GradesController ===&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately.&lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Refactor the create function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T3: Refactor the update function in LatePoliciesController to make the code more modular&lt;br /&gt;
*T4: Modify the GradesController to deduct the total penalty from the total score&lt;br /&gt;
*T5: Modify the ViewScores view to display the penalties deducted&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
The following steps can be followed from the Web UI to ensure that the penalty is deducted and the correct scores are updated according to the specified late policy.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#Set the deadline for the assignment &lt;br /&gt;
#Add a late policy&lt;br /&gt;
#Create a team of 2-3 students &lt;br /&gt;
#Login as a student to submit the assignment and the reviews&lt;br /&gt;
#Make sure to add certain late submission&lt;br /&gt;
#Check the scores to make sure that the penalties are deducted from the total score&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103998</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103998"/>
		<updated>2016-10-29T21:31:34Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* Files Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
The files modified for the penalty functionality to work are as follows,&lt;br /&gt;
==== Controllers ====&lt;br /&gt;
*late_policies_controller.rb&lt;br /&gt;
*grades_controller.rb&lt;br /&gt;
==== Helpers ====&lt;br /&gt;
*penalty_helper.rb&lt;br /&gt;
==== Views ====&lt;br /&gt;
*_participant.html.erb&lt;br /&gt;
*_participant_charts.html.erb&lt;br /&gt;
*_participant_title.html.erb&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment, where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. The create and the update functions in this module was very long and it had to be refactored so that the code was modular.&lt;br /&gt;
=== GradesController ===&lt;br /&gt;
In grades controller, the total penalty was not getting deducted from the total score due to the mismatch of conditions. The conditions were modified in this controller for the penalty to be deducted from the total score obtained. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties. This function was not returning the values of the calculated penalty as required and modifications were made so that the correct penalty values are returned.&lt;br /&gt;
=== Views ===&lt;br /&gt;
In the current implementation, the penalty deducted is not displayed when a student views scores. The views were modified so that the deducted penalties and total score are displayed appropriately.&lt;br /&gt;
&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Modification of LatePoliciesController so that it &lt;br /&gt;
*T3: Refactor the LatePoliciesController to make the code more readable and intuitive&lt;br /&gt;
*T4: The calculated penalty should be deducted from the score obtained by the student&lt;br /&gt;
*T5: The deducted penalty and the new score should be visible to the students&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
The following steps can be followed from the Web UI to ensure that the penalty is deducted and the correct scores are updated according to the specified late policy.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#Set the deadline for the assignment &lt;br /&gt;
#Add a late policy&lt;br /&gt;
#Create a team of 2-3 students &lt;br /&gt;
#Login as a student to submit the assignment and the reviews&lt;br /&gt;
#Make sure to add certain late submission&lt;br /&gt;
#Check the scores to make sure that the penalties are deducted from the total score&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Smurali8&amp;diff=103263</id>
		<title>User:Smurali8</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Smurali8&amp;diff=103263"/>
		<updated>2016-10-28T23:12:15Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: moved User:Smurali8 to CSC/ECE 517 Fall 2016/OSS E1637&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Fall 2016/OSS E1637]]&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103262</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103262"/>
		<updated>2016-10-28T23:12:15Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: moved User:Smurali8 to CSC/ECE 517 Fall 2016/OSS E1637&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
There are two files modified in this project, namely late_policies_controller.rb and penalty_helper.rb.&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. In gradescontroller.rb, there is a function that calculates the penalty according to all the specified constraints. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties.&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Modification of LatePoliciesController so that it &lt;br /&gt;
*T3: Refactor the LatePoliciesController to make the code more readable and intuitive&lt;br /&gt;
*T4: The calculated penalty should be deducted from the score obtained by the student&lt;br /&gt;
*T5: The deducted penalty and the new score should be visible to the students&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
The following steps can be followed from the Web UI to ensure that the penalty is deducted and the correct scores are updated according to the specified late policy.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#Set the deadline for the assignment &lt;br /&gt;
#Add a late policy&lt;br /&gt;
#Create a team of 2-3 students &lt;br /&gt;
#Login as a student to submit the assignment and the reviews&lt;br /&gt;
#Make sure to add certain late submission&lt;br /&gt;
#Check the scores to make sure that the penalties are deducted from the total score&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103260</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103260"/>
		<updated>2016-10-28T23:10:56Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* E1637: Refactor penalty_helper.rb and late_policies_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
There are two files modified in this project, namely late_policies_controller.rb and penalty_helper.rb.&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. In gradescontroller.rb, there is a function that calculates the penalty according to all the specified constraints. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties.&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Modification of LatePoliciesController so that it &lt;br /&gt;
*T3: Refactor the LatePoliciesController to make the code more readable and intuitive&lt;br /&gt;
*T4: The calculated penalty should be deducted from the score obtained by the student&lt;br /&gt;
*T5: The deducted penalty and the new score should be visible to the students&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
The following steps can be followed from the Web UI to ensure that the penalty is deducted and the correct scores are updated according to the specified late policy.&lt;br /&gt;
#Login as instructor&lt;br /&gt;
#Create an assignment in course&lt;br /&gt;
#Set the deadline for the assignment &lt;br /&gt;
#Add a late policy&lt;br /&gt;
#Create a team of 2-3 students &lt;br /&gt;
#Login as a student to submit the assignment and the reviews&lt;br /&gt;
#Make sure to add certain late submission&lt;br /&gt;
#Check the scores to make sure that the penalties are deducted from the total score&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103234</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103234"/>
		<updated>2016-10-28T22:56:45Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* List of Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
There are two files modified in this project, namely late_policies_controller.rb and penalty_helper.rb.&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. In gradescontroller.rb, there is a function that calculates the penalty according to all the specified constraints. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties.&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
*T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
*T2: Refactor the LatePoliciesController to make the code more readable and intuitive&lt;br /&gt;
*T3: The calculated penalty should be deducted from the score obtained by the student&lt;br /&gt;
*T4: The deducted penalty and the new score should be visible to the students&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103228</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103228"/>
		<updated>2016-10-28T22:55:24Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* E1637: Refactor penalty_helper.rb and late_policies_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
There are two files modified in this project, namely late_policies_controller.rb and penalty_helper.rb.&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. In gradescontroller.rb, there is a function that calculates the penalty according to all the specified constraints. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties.&lt;br /&gt;
== List of Tasks ==&lt;br /&gt;
T1: Modification to the PenaltyHelper so that correct penalty value is calculated and returned&lt;br /&gt;
T2: Refactor the LatePoliciesController to make the code more readable and intuitive&lt;br /&gt;
T3: The calculated penalty should be deducted from the score obtained by the student&lt;br /&gt;
T4: The deducted penalty and the new score should be visible to the students&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103222</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103222"/>
		<updated>2016-10-28T22:47:53Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1637: Refactor penalty_helper.rb and late_policies_controller.rb =&lt;br /&gt;
== Expertiza ==&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
== Motivation ==&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
There are two files modified in this project, namely late_policies_controller.rb and penalty_helper.rb.&lt;br /&gt;
=== LatePolicyController ===&lt;br /&gt;
This controller contains the functions to create, update and delete a late policy. The instructor can create a late policy for any assignment where in the instructor can specify the points per unit and the maximum penalty that can be applied for a particular assignment. In gradescontroller.rb, there is a function that calculates the penalty according to all the specified constraints. &lt;br /&gt;
=== PenaltyHelper ===&lt;br /&gt;
This helper file has functions to calculate submission, review and metareview penalties.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103139</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=103139"/>
		<updated>2016-10-28T22:01:29Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* CSC/ECE 517 Fall 2016/OSS E1637 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= CSC/ECE 517 Fall 2016/OSS E1637 =&lt;br /&gt;
== E1637: Refactor penalty_helper.rb and late_policies_controller.rb ==&lt;br /&gt;
=== Expertiza ===&lt;br /&gt;
Expertiza is an educational web application built on Ruby on Rails framework. It provides functionality for the instructor to create assignments for a specific course. The students can sign up for a list of topics created by the instructor. Expertiza allows students to form teams and work together. Students can provide feedback to assignments and projects submitted by other students. The students can also provide reviews about each individual member in their team as well. The numerous functionalities provided by expertiza makes the process of assignment submission, feedback and management much simpler and for the students and the instructors. &lt;br /&gt;
=== Motivation ===&lt;br /&gt;
This project deals with LatePoliciesController and PenaltyHelper files. It focuses on calculating a penalty which would be deducted from the total score obtained by the student if the student submits the assignment or review past the specified deadline. The goal of our project is to make the task of calculating and deducting penalties function perfectly and also refactor the code to make it more intuitive and modular.&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=102787</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=102787"/>
		<updated>2016-10-28T17:55:31Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: /* CSC/ECE 517 Fall 2016/OSS E1637 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= CSC/ECE 517 Fall 2016/OSS E1637 =&lt;br /&gt;
== E1637: Refactor penalty_helper.rb and late_policies_controller.rb ==&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=102784</id>
		<title>CSC/ECE 517 Fall 2016/OSS E1637</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2016/OSS_E1637&amp;diff=102784"/>
		<updated>2016-10-28T17:51:54Z</updated>

		<summary type="html">&lt;p&gt;Smurali8: Created page with &amp;quot;= CSC/ECE 517 Fall 2016/OSS E1637 =&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= CSC/ECE 517 Fall 2016/OSS E1637 =&lt;/div&gt;</summary>
		<author><name>Smurali8</name></author>
	</entry>
</feed>