<?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=Pechopel</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=Pechopel"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pechopel"/>
	<updated>2026-05-18T08:52:22Z</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_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160707</id>
		<title>CSC/ECE 517 Fall 2024 - E2486.Reimplement deadline rights and deadline types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160707"/>
		<updated>2024-12-04T05:09:08Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Project 4 Design Doc=&lt;br /&gt;
==Issues==&lt;br /&gt;
1. '''Determining Late Submissions:'''&lt;br /&gt;
* There is a need to calculate whether submissions or reviews are late based on the due dates.&lt;br /&gt;
* '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.&lt;br /&gt;
&lt;br /&gt;
2. '''Handling Late Team Formation:'''&lt;br /&gt;
* Teams that form after the due date should incur a penalty.&lt;br /&gt;
* '''Issue:''' Team formation dates may not be explicitly tracked in the current system, or if they are, they are not used for penalty calculation.&lt;br /&gt;
&lt;br /&gt;
3. '''Handling Review Penalties:'''&lt;br /&gt;
* Participants who fail to complete reviews on time should incur a penalty as well.&lt;br /&gt;
* '''Issue:''' Reviews are often tied to the response maps or individual participants, so there's a challenge in ensuring penalties are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* The penalty calculation should be easily extensible, and transparent for debugging.&lt;br /&gt;
* '''Issue:''' Penalties may need to be applied in multiple places within the codebase, but should be kept modular and readable.&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* The code should remain maintainable as penalties could apply to more parts of the application in the future.&lt;br /&gt;
* '''Issue:''' Repeating penalty logic across models may lead to code duplication, increasing maintenance cost.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solutions==&lt;br /&gt;
A. '''Introduction of a PenaltyCalculator Mixin'''&lt;br /&gt;
* '''Solution:''' A new module `PenaltyCalculator` will be created to handle the penalty calculations. This module will contain methods for calculating submission, review, and team formation penalties.&lt;br /&gt;
* '''Benefit:''' It makes the penalty calculation logic reusable, keeps the code DRY, and ensures the logic is centralized.&lt;br /&gt;
&lt;br /&gt;
B. '''Tracking Submission Dates'''&lt;br /&gt;
* '''Solution:''' Ensure that submission dates are explicitly tracked in the `Submission` model. Add a method to check if a submission is late based on the due date.&lt;br /&gt;
* '''Benefit:''' Provides a straightforward way to identify late submissions and apply penalties accordingly.&lt;br /&gt;
&lt;br /&gt;
C. '''Tracking Team Formation Dates'''&lt;br /&gt;
* '''Solution:''' Use the team formation date in the `Team` model to track when a team is formed. Use this date to calculate penalties for late team formation.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late team formation are applied consistently and accurately.&lt;br /&gt;
&lt;br /&gt;
D. '''Handling Review Penalties'''&lt;br /&gt;
* '''Solution:''' Extend the `PenaltyCalculator` mixin to include methods for calculating penalties for late reviews. Ensure that review deadlines are tracked and used in penalty calculations.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late reviews are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
E. '''Extensible Penalty Application'''&lt;br /&gt;
* '''Solution:''' Design the `PenaltyCalculator` mixin to be easily extensible, allowing new types of penalties to be added in the future. Use clear and transparent methods for debugging.&lt;br /&gt;
* '''Benefit:''' Keeps the penalty calculation logic modular and readable, making it easier to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
F. '''Code Maintainability and Readability'''&lt;br /&gt;
* '''Solution:''' Centralize the penalty calculation logic in the `PenaltyCalculator` mixin to avoid code duplication. Ensure that the mixin is included in relevant models where penalties need to be applied.&lt;br /&gt;
* '''Benefit:''' Reduces code duplication, making the codebase easier to maintain and ensuring that penalty logic is consistent across the application.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:PenaltyMixinUML.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
    module PenaltyCalculator&lt;br /&gt;
      def calculate_penalty(submission_date, due_date, penalty_rate)&lt;br /&gt;
        return 0 if submission_date &amp;lt;= due_date&lt;br /&gt;
        days_late = (submission_date.to_date - due_date.to_date).to_i&lt;br /&gt;
        penalty = days_late * penalty_rate&lt;br /&gt;
        penalty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==Summary of Proposed File Changes==&lt;br /&gt;
&lt;br /&gt;
* app/lib/penalty_calculator.rb (new file)&lt;br /&gt;
* app/models/assignment.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/submission.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/participant.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/team.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* config/application.rb (modify to ensure lib directory is autoloaded)&lt;br /&gt;
* spec/lib/penalty_calculator_spec.rb (new file for unit tests)&lt;br /&gt;
* spec/models/assignment_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/submission_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/participant_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/team_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Final Implementation=&lt;br /&gt;
==Resolving Issues==&lt;br /&gt;
1. '''Determining Late Submissions''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
2. '''Handling Late Team Formation''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
3. '''Handling Review Penalties'''&lt;br /&gt;
* Our solution simplifies the different types of penalties and enables a single type of penalty to be used for all applications.&lt;br /&gt;
* '''Solution:''' Update calculate_penalty in late_policy.rb to determine penalty units and calculate total penalty&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def calculate_penalty(submission_time, due_date)&lt;br /&gt;
    return 0 if submission_time &amp;lt;= due_date&lt;br /&gt;
&lt;br /&gt;
    time_diff = submission_time - due_date&lt;br /&gt;
    penalty_units = case penalty_unit&lt;br /&gt;
                    when 'Minute'&lt;br /&gt;
                      time_diff / 60&lt;br /&gt;
                    when 'Hour'&lt;br /&gt;
                      time_diff / 3600&lt;br /&gt;
                    when 'Day'&lt;br /&gt;
                      time_diff / 86400&lt;br /&gt;
                    else&lt;br /&gt;
                      raise 'Invalid penalty unit'&lt;br /&gt;
                    end&lt;br /&gt;
&lt;br /&gt;
    raise 'Penalty per unit is missing' if penalty_per_unit.nil?&lt;br /&gt;
    penalty = penalty_units * penalty_per_unit&lt;br /&gt;
    [penalty, max_penalty].min.round(2)&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* '''Solution:''' Include ScoreCalculationHelper mixin in response.rb and update aggregate_questionnaire_score to calculate and apply penalty to score&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class Response &amp;lt; ApplicationRecord&lt;br /&gt;
    include ScoreCalculationHelper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      def aggregate_questionnaire_score&lt;br /&gt;
        # only count the scorable questions, only when the answer is not nil&lt;br /&gt;
        # we accept nil as answer for scorable questions, and they will not be counted towards the total score&lt;br /&gt;
        sum = 0&lt;br /&gt;
        scores.each do |s|&lt;br /&gt;
          question = Question.find(s.question_id)&lt;br /&gt;
          # For quiz responses, the weights will be 1 or 0, depending on if correct&lt;br /&gt;
          sum += s.answer * question.weight unless s.answer.nil? || !question.is_a?(ScoredQuestion)&lt;br /&gt;
        end&lt;br /&gt;
        sum&lt;br /&gt;
        penalty = LatePolicy.calculate_penalty(submission_time, due_date)&lt;br /&gt;
        apply_penalty(sum, penalty)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* '''Solution:''' Maintaining penalty calculation and application in its own module ensures readability and limits potential for duplicate code elsewhere in the codebase&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
   module ScoreCalculationHelper&lt;br /&gt;
     def weighted_score(scores, weights)&lt;br /&gt;
       total_weight = weights.sum&lt;br /&gt;
       # Multiply each score by its weight, then divide by the total weight&lt;br /&gt;
       weighted_scores = scores.zip(weights).map { |score, weight| score * weight }&lt;br /&gt;
       weighted_scores.sum / total_weight&lt;br /&gt;
     end&lt;br /&gt;
     def apply_penalty(score, penalty)&lt;br /&gt;
       score - (score * penalty / 100.0)&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
==Design Patterns and Principles==&lt;br /&gt;
While not an explicit implementation, our extension of LatePolicy logic adhered to the Decorator pattern by extending penalty behaviors and adding new parameters like penalty_per_unit and max_penalty. Additonally, we were able to harness the Open/Closed principle in both LatePolicy and DeadlineType by those classes allowing us to create new penalty units (Minutes/Hours/Days) and new types of deadlines for bidding for topics and reviews. Another example of a classic foundational principle, encapsulation, can be found in our implementation of calculate_penalty. Allowing the LatePolicy to do the calculation keeps the logic for the penalties separate from the response and any other classes that might use late policies.&lt;br /&gt;
&lt;br /&gt;
==Test Cases==&lt;br /&gt;
Testing is primarily centered around score_calculation_helper.rb with some additional testing in late_policy.rb due to its close ties with penalty enforcement. Other adjustments include stubbing DueDates to ensure the DueDate object returns the proper due_at for your tests: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;allow(DueDate).to receive(:find_by).and_return(double('DueDate', due_at: due_date))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some benefits to stubbing DueDate this way:&lt;br /&gt;
*'''Consistency:''' The due_date object is now controlled, avoiding reliance on any database or external factors.&lt;br /&gt;
*'''Flexibility:''' You can easily modify the due_date within each test case.&lt;br /&gt;
* Isolates the behavior of LatePolicy from database interactions.&lt;br /&gt;
* Makes tests faster and more predictable.&lt;br /&gt;
* Focuses solely on the calculate_penalty logic&lt;br /&gt;
&lt;br /&gt;
Stubbing example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#calculate_penalty' do&lt;br /&gt;
    let(:late_policy) { LatePolicy.new(penalty_unit: 'InvalidUnit', penalty_per_unit: 10, max_penalty: 100) }&lt;br /&gt;
    let(:due_date) { Time.now }&lt;br /&gt;
    before do&lt;br /&gt;
      # Stub the due_date object with the desired behavior&lt;br /&gt;
      allow(DueDate).to receive(:find_by).and_return(double('DueDate', due_at: due_date))&lt;br /&gt;
    end&lt;br /&gt;
    it 'raises an error if the penalty unit is invalid' do&lt;br /&gt;
      submission_time = Time.now + 1.hour&lt;br /&gt;
      # Expecting an error due to invalid penalty unit&lt;br /&gt;
      expect { late_policy.calculate_penalty(submission_time, due_date) }.to raise_error('Invalid. Penalty unit must be Minute, Hour or Day')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As our helper is tasked only with computing and applying penalties, our testing revolved primarily around ensuring scoring is correct after penalties are applied.&lt;br /&gt;
&lt;br /&gt;
Example score_calculation_helper.rb test for computation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#apply_penalty' do&lt;br /&gt;
    it 'reduces the score by the correct percentage penalty' do&lt;br /&gt;
      score = 100&lt;br /&gt;
      penalty = 20&lt;br /&gt;
      expect(apply_penalty(score, penalty)).to eq(80.0)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example test for handling negative numbers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#apply_penalty' do&lt;br /&gt;
    it 'raises an error if penalty is negative' do&lt;br /&gt;
      score = 100&lt;br /&gt;
      penalty = -20&lt;br /&gt;
      expect { apply_penalty(score, penalty) }.to raise_error(ArgumentError)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Late policies add in a small additional layer of complexity by seeing how late a submission is and using that to determine the penalty that should be applied.&lt;br /&gt;
&lt;br /&gt;
Example late_policy_spec.rb test for applying a max penalty:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#calculate_penalty' do&lt;br /&gt;
    it 'returns the max penalty when calculated penalty exceeds max_penalty' do&lt;br /&gt;
      submission_time = Time.now + 10.days&lt;br /&gt;
      due_date = Time.now&lt;br /&gt;
      late_policy = LatePolicy.new(penalty_unit: 'Day', penalty_per_unit: 20, max_penalty: 50)&lt;br /&gt;
      # Time difference is 10 days, calculated penalty would be 10 * 20 = 200&lt;br /&gt;
      # But since the max penalty is 50, it should return 50&lt;br /&gt;
      expect(late_policy.calculate_penalty(submission_time, due_date)).to eq(50)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160586</id>
		<title>CSC/ECE 517 Fall 2024 - E2486.Reimplement deadline rights and deadline types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160586"/>
		<updated>2024-12-04T03:47:42Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Project 4 Design Doc=&lt;br /&gt;
==Issues==&lt;br /&gt;
1. '''Determining Late Submissions:'''&lt;br /&gt;
* There is a need to calculate whether submissions or reviews are late based on the due dates.&lt;br /&gt;
* '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.&lt;br /&gt;
&lt;br /&gt;
2. '''Handling Late Team Formation:'''&lt;br /&gt;
* Teams that form after the due date should incur a penalty.&lt;br /&gt;
* '''Issue:''' Team formation dates may not be explicitly tracked in the current system, or if they are, they are not used for penalty calculation.&lt;br /&gt;
&lt;br /&gt;
3. '''Handling Review Penalties:'''&lt;br /&gt;
* Participants who fail to complete reviews on time should incur a penalty as well.&lt;br /&gt;
* '''Issue:''' Reviews are often tied to the response maps or individual participants, so there's a challenge in ensuring penalties are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* The penalty calculation should be easily extensible, and transparent for debugging.&lt;br /&gt;
* '''Issue:''' Penalties may need to be applied in multiple places within the codebase, but should be kept modular and readable.&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* The code should remain maintainable as penalties could apply to more parts of the application in the future.&lt;br /&gt;
* '''Issue:''' Repeating penalty logic across models may lead to code duplication, increasing maintenance cost.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solutions==&lt;br /&gt;
A. '''Introduction of a PenaltyCalculator Mixin'''&lt;br /&gt;
* '''Solution:''' A new module `PenaltyCalculator` will be created to handle the penalty calculations. This module will contain methods for calculating submission, review, and team formation penalties.&lt;br /&gt;
* '''Benefit:''' It makes the penalty calculation logic reusable, keeps the code DRY, and ensures the logic is centralized.&lt;br /&gt;
&lt;br /&gt;
B. '''Tracking Submission Dates'''&lt;br /&gt;
* '''Solution:''' Ensure that submission dates are explicitly tracked in the `Submission` model. Add a method to check if a submission is late based on the due date.&lt;br /&gt;
* '''Benefit:''' Provides a straightforward way to identify late submissions and apply penalties accordingly.&lt;br /&gt;
&lt;br /&gt;
C. '''Tracking Team Formation Dates'''&lt;br /&gt;
* '''Solution:''' Use the team formation date in the `Team` model to track when a team is formed. Use this date to calculate penalties for late team formation.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late team formation are applied consistently and accurately.&lt;br /&gt;
&lt;br /&gt;
D. '''Handling Review Penalties'''&lt;br /&gt;
* '''Solution:''' Extend the `PenaltyCalculator` mixin to include methods for calculating penalties for late reviews. Ensure that review deadlines are tracked and used in penalty calculations.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late reviews are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
E. '''Extensible Penalty Application'''&lt;br /&gt;
* '''Solution:''' Design the `PenaltyCalculator` mixin to be easily extensible, allowing new types of penalties to be added in the future. Use clear and transparent methods for debugging.&lt;br /&gt;
* '''Benefit:''' Keeps the penalty calculation logic modular and readable, making it easier to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
F. '''Code Maintainability and Readability'''&lt;br /&gt;
* '''Solution:''' Centralize the penalty calculation logic in the `PenaltyCalculator` mixin to avoid code duplication. Ensure that the mixin is included in relevant models where penalties need to be applied.&lt;br /&gt;
* '''Benefit:''' Reduces code duplication, making the codebase easier to maintain and ensuring that penalty logic is consistent across the application.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:PenaltyMixinUML.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
    module PenaltyCalculator&lt;br /&gt;
      def calculate_penalty(submission_date, due_date, penalty_rate)&lt;br /&gt;
        return 0 if submission_date &amp;lt;= due_date&lt;br /&gt;
        days_late = (submission_date.to_date - due_date.to_date).to_i&lt;br /&gt;
        penalty = days_late * penalty_rate&lt;br /&gt;
        penalty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==Summary of Proposed File Changes==&lt;br /&gt;
&lt;br /&gt;
* app/lib/penalty_calculator.rb (new file)&lt;br /&gt;
* app/models/assignment.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/submission.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/participant.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/team.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* config/application.rb (modify to ensure lib directory is autoloaded)&lt;br /&gt;
* spec/lib/penalty_calculator_spec.rb (new file for unit tests)&lt;br /&gt;
* spec/models/assignment_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/submission_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/participant_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/team_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Final Implementation=&lt;br /&gt;
==Resolving Issues==&lt;br /&gt;
1. '''Determining Late Submissions''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
2. '''Handling Late Team Formation''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
3. '''Handling Review Penalties'''&lt;br /&gt;
* Our solution simplifies the different types of penalties and enables a single type of penalty to be used for all applications.&lt;br /&gt;
* '''Solution:''' Update calculate_penalty in late_policy.rb to determine penalty units and calculate total penalty&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def calculate_penalty(submission_time, due_date)&lt;br /&gt;
    return 0 if submission_time &amp;lt;= due_date&lt;br /&gt;
&lt;br /&gt;
    time_diff = submission_time - due_date&lt;br /&gt;
    penalty_units = case penalty_unit&lt;br /&gt;
                    when 'Minute'&lt;br /&gt;
                      time_diff / 60&lt;br /&gt;
                    when 'Hour'&lt;br /&gt;
                      time_diff / 3600&lt;br /&gt;
                    when 'Day'&lt;br /&gt;
                      time_diff / 86400&lt;br /&gt;
                    else&lt;br /&gt;
                      raise 'Invalid penalty unit'&lt;br /&gt;
                    end&lt;br /&gt;
&lt;br /&gt;
    raise 'Penalty per unit is missing' if penalty_per_unit.nil?&lt;br /&gt;
    penalty = penalty_units * penalty_per_unit&lt;br /&gt;
    [penalty, max_penalty].min.round(2)&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* '''Solution:''' Include ScoreCalculationHelper mixin in response.rb and update aggregate_questionnaire_score to calculate and apply penalty to score&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class Response &amp;lt; ApplicationRecord&lt;br /&gt;
    include ScoreCalculationHelper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      def aggregate_questionnaire_score&lt;br /&gt;
        # only count the scorable questions, only when the answer is not nil&lt;br /&gt;
        # we accept nil as answer for scorable questions, and they will not be counted towards the total score&lt;br /&gt;
        sum = 0&lt;br /&gt;
        scores.each do |s|&lt;br /&gt;
          question = Question.find(s.question_id)&lt;br /&gt;
          # For quiz responses, the weights will be 1 or 0, depending on if correct&lt;br /&gt;
          sum += s.answer * question.weight unless s.answer.nil? || !question.is_a?(ScoredQuestion)&lt;br /&gt;
        end&lt;br /&gt;
        sum&lt;br /&gt;
        penalty = LatePolicy.calculate_penalty(submission_time, due_date)&lt;br /&gt;
        apply_penalty(sum, penalty)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* '''Solution:''' Maintaining penalty calculation and application in its own module ensures readability and limits potential for duplicate code elsewhere in the codebase&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
   module ScoreCalculationHelper&lt;br /&gt;
     def weighted_score(scores, weights)&lt;br /&gt;
       total_weight = weights.sum&lt;br /&gt;
       # Multiply each score by its weight, then divide by the total weight&lt;br /&gt;
       weighted_scores = scores.zip(weights).map { |score, weight| score * weight }&lt;br /&gt;
       weighted_scores.sum / total_weight&lt;br /&gt;
     end&lt;br /&gt;
     def apply_penalty(score, penalty)&lt;br /&gt;
       score - (score * penalty / 100.0)&lt;br /&gt;
     end&lt;br /&gt;
   end``&lt;br /&gt;
&lt;br /&gt;
==Test Cases==&lt;br /&gt;
Testing is primarily centered around score_calculation_helper.rb with some additional testing in late_policy.rb due to its close ties with penalty enforcement. Other adjustments include stubbing DueDates to ensure the DueDate object returns the proper due_at for your tests: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;allow(DueDate).to receive(:find_by).and_return(double('DueDate', due_at: due_date))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some benefits to stubbing DueDate this way:&lt;br /&gt;
*'''Consistency:''' The due_date object is now controlled, avoiding reliance on any database or external factors.&lt;br /&gt;
*'''Flexibility:''' You can easily modify the due_date within each test case.&lt;br /&gt;
* Isolates the behavior of LatePolicy from database interactions.&lt;br /&gt;
* Makes tests faster and more predictable.&lt;br /&gt;
* Focuses solely on the calculate_penalty logic&lt;br /&gt;
&lt;br /&gt;
Stubbing example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#calculate_penalty' do&lt;br /&gt;
    let(:late_policy) { LatePolicy.new(penalty_unit: 'InvalidUnit', penalty_per_unit: 10, max_penalty: 100) }&lt;br /&gt;
    let(:due_date) { Time.now }&lt;br /&gt;
    before do&lt;br /&gt;
      # Stub the due_date object with the desired behavior&lt;br /&gt;
      allow(DueDate).to receive(:find_by).and_return(double('DueDate', due_at: due_date))&lt;br /&gt;
    end&lt;br /&gt;
    it 'raises an error if the penalty unit is invalid' do&lt;br /&gt;
      submission_time = Time.now + 1.hour&lt;br /&gt;
      # Expecting an error due to invalid penalty unit&lt;br /&gt;
      expect { late_policy.calculate_penalty(submission_time, due_date) }.to raise_error('Invalid. Penalty unit must be Minute, Hour or Day')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As our helper is tasked only with computing and applying penalties, our testing revolved primarily around ensuring scoring is correct after penalties are applied.&lt;br /&gt;
&lt;br /&gt;
Example score_calculation_helper.rb test for computation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#apply_penalty' do&lt;br /&gt;
    it 'reduces the score by the correct percentage penalty' do&lt;br /&gt;
      score = 100&lt;br /&gt;
      penalty = 20&lt;br /&gt;
      expect(apply_penalty(score, penalty)).to eq(80.0)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example test for handling negative numbers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#apply_penalty' do&lt;br /&gt;
    it 'raises an error if penalty is negative' do&lt;br /&gt;
      score = 100&lt;br /&gt;
      penalty = -20&lt;br /&gt;
      expect { apply_penalty(score, penalty) }.to raise_error(ArgumentError)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Late policies add in a small additional layer of complexity by seeing how late a submission is and using that to determine the penalty that should be applied.&lt;br /&gt;
&lt;br /&gt;
Example late_policy_spec.rb test for applying a max penalty:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#calculate_penalty' do&lt;br /&gt;
    it 'returns the max penalty when calculated penalty exceeds max_penalty' do&lt;br /&gt;
      submission_time = Time.now + 10.days&lt;br /&gt;
      due_date = Time.now&lt;br /&gt;
      late_policy = LatePolicy.new(penalty_unit: 'Day', penalty_per_unit: 20, max_penalty: 50)&lt;br /&gt;
      # Time difference is 10 days, calculated penalty would be 10 * 20 = 200&lt;br /&gt;
      # But since the max penalty is 50, it should return 50&lt;br /&gt;
      expect(late_policy.calculate_penalty(submission_time, due_date)).to eq(50)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160334</id>
		<title>CSC/ECE 517 Fall 2024 - E2486.Reimplement deadline rights and deadline types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=160334"/>
		<updated>2024-12-04T00:05:30Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Project 4 Design Doc=&lt;br /&gt;
==Issues==&lt;br /&gt;
1. '''Determining Late Submissions:'''&lt;br /&gt;
* There is a need to calculate whether submissions or reviews are late based on the due dates.&lt;br /&gt;
* '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.&lt;br /&gt;
&lt;br /&gt;
2. '''Handling Late Team Formation:'''&lt;br /&gt;
* Teams that form after the due date should incur a penalty.&lt;br /&gt;
* '''Issue:''' Team formation dates may not be explicitly tracked in the current system, or if they are, they are not used for penalty calculation.&lt;br /&gt;
&lt;br /&gt;
3. '''Handling Review Penalties:'''&lt;br /&gt;
* Participants who fail to complete reviews on time should incur a penalty as well.&lt;br /&gt;
* '''Issue:''' Reviews are often tied to the response maps or individual participants, so there's a challenge in ensuring penalties are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* The penalty calculation should be easily extensible, and transparent for debugging.&lt;br /&gt;
* '''Issue:''' Penalties may need to be applied in multiple places within the codebase, but should be kept modular and readable.&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* The code should remain maintainable as penalties could apply to more parts of the application in the future.&lt;br /&gt;
* '''Issue:''' Repeating penalty logic across models may lead to code duplication, increasing maintenance cost.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solutions==&lt;br /&gt;
A. '''Introduction of a PenaltyCalculator Mixin'''&lt;br /&gt;
* '''Solution:''' A new module `PenaltyCalculator` will be created to handle the penalty calculations. This module will contain methods for calculating submission, review, and team formation penalties.&lt;br /&gt;
* '''Benefit:''' It makes the penalty calculation logic reusable, keeps the code DRY, and ensures the logic is centralized.&lt;br /&gt;
&lt;br /&gt;
B. '''Tracking Submission Dates'''&lt;br /&gt;
* '''Solution:''' Ensure that submission dates are explicitly tracked in the `Submission` model. Add a method to check if a submission is late based on the due date.&lt;br /&gt;
* '''Benefit:''' Provides a straightforward way to identify late submissions and apply penalties accordingly.&lt;br /&gt;
&lt;br /&gt;
C. '''Tracking Team Formation Dates'''&lt;br /&gt;
* '''Solution:''' Use the team formation date in the `Team` model to track when a team is formed. Use this date to calculate penalties for late team formation.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late team formation are applied consistently and accurately.&lt;br /&gt;
&lt;br /&gt;
D. '''Handling Review Penalties'''&lt;br /&gt;
* '''Solution:''' Extend the `PenaltyCalculator` mixin to include methods for calculating penalties for late reviews. Ensure that review deadlines are tracked and used in penalty calculations.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late reviews are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
E. '''Extensible Penalty Application'''&lt;br /&gt;
* '''Solution:''' Design the `PenaltyCalculator` mixin to be easily extensible, allowing new types of penalties to be added in the future. Use clear and transparent methods for debugging.&lt;br /&gt;
* '''Benefit:''' Keeps the penalty calculation logic modular and readable, making it easier to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
F. '''Code Maintainability and Readability'''&lt;br /&gt;
* '''Solution:''' Centralize the penalty calculation logic in the `PenaltyCalculator` mixin to avoid code duplication. Ensure that the mixin is included in relevant models where penalties need to be applied.&lt;br /&gt;
* '''Benefit:''' Reduces code duplication, making the codebase easier to maintain and ensuring that penalty logic is consistent across the application.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:PenaltyMixinUML.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
    module PenaltyCalculator&lt;br /&gt;
      def calculate_penalty(submission_date, due_date, penalty_rate)&lt;br /&gt;
        return 0 if submission_date &amp;lt;= due_date&lt;br /&gt;
        days_late = (submission_date.to_date - due_date.to_date).to_i&lt;br /&gt;
        penalty = days_late * penalty_rate&lt;br /&gt;
        penalty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==Summary of Proposed File Changes==&lt;br /&gt;
&lt;br /&gt;
* app/lib/penalty_calculator.rb (new file)&lt;br /&gt;
* app/models/assignment.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/submission.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/participant.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/team.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* config/application.rb (modify to ensure lib directory is autoloaded)&lt;br /&gt;
* spec/lib/penalty_calculator_spec.rb (new file for unit tests)&lt;br /&gt;
* spec/models/assignment_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/submission_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/participant_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/team_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Final Implementation=&lt;br /&gt;
==Resolving Issues==&lt;br /&gt;
1. '''Determining Late Submissions''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
2. '''Handling Late Team Formation''' &amp;amp;&amp;amp;&amp;lt;br&amp;gt;&lt;br /&gt;
3. '''Handling Review Penalties'''&lt;br /&gt;
* Our solution simplifies the different types of penalties and enables a single type of penalty to be used for all applications.&lt;br /&gt;
* '''Solution:''' Update calculate_penalty in late_policy.rb to determine penalty units and calculate total penalty&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def calculate_penalty(submission_time, due_date)&lt;br /&gt;
    return 0 if submission_time &amp;lt;= due_date&lt;br /&gt;
&lt;br /&gt;
    time_diff = submission_time - due_date&lt;br /&gt;
    penalty_units = case penalty_unit&lt;br /&gt;
                    when 'Minute'&lt;br /&gt;
                      time_diff / 60&lt;br /&gt;
                    when 'Hour'&lt;br /&gt;
                      time_diff / 3600&lt;br /&gt;
                    when 'Day'&lt;br /&gt;
                      time_diff / 86400&lt;br /&gt;
                    else&lt;br /&gt;
                      raise 'Invalid penalty unit'&lt;br /&gt;
                    end&lt;br /&gt;
&lt;br /&gt;
    raise 'Penalty per unit is missing' if penalty_per_unit.nil?&lt;br /&gt;
    penalty = penalty_units * penalty_per_unit&lt;br /&gt;
    [penalty, max_penalty].min.round(2)&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* '''Solution:''' Include ScoreCalculationHelper mixin in response.rb and update aggregate_questionnaire_score to calculate and apply penalty to score&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  class Response &amp;lt; ApplicationRecord&lt;br /&gt;
    include ScoreCalculationHelper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      def aggregate_questionnaire_score&lt;br /&gt;
        # only count the scorable questions, only when the answer is not nil&lt;br /&gt;
        # we accept nil as answer for scorable questions, and they will not be counted towards the total score&lt;br /&gt;
        sum = 0&lt;br /&gt;
        scores.each do |s|&lt;br /&gt;
          question = Question.find(s.question_id)&lt;br /&gt;
          # For quiz responses, the weights will be 1 or 0, depending on if correct&lt;br /&gt;
          sum += s.answer * question.weight unless s.answer.nil? || !question.is_a?(ScoredQuestion)&lt;br /&gt;
        end&lt;br /&gt;
        sum&lt;br /&gt;
        penalty = LatePolicy.calculate_penalty(submission_time, due_date)&lt;br /&gt;
        apply_penalty(sum, penalty)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* '''Solution:''' Maintaining penalty calculation and application in its own module ensures readability and limits potential for duplicate code elsewhere in the codebase&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
   module ScoreCalculationHelper&lt;br /&gt;
     def weighted_score(scores, weights)&lt;br /&gt;
       total_weight = weights.sum&lt;br /&gt;
       # Multiply each score by its weight, then divide by the total weight&lt;br /&gt;
       weighted_scores = scores.zip(weights).map { |score, weight| score * weight }&lt;br /&gt;
       weighted_scores.sum / total_weight&lt;br /&gt;
     end&lt;br /&gt;
     def apply_penalty(score, penalty)&lt;br /&gt;
       score - (score * penalty / 100.0)&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159608</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159608"/>
		<updated>2024-11-15T01:56:54Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159607</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159607"/>
		<updated>2024-11-15T01:56:44Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159606</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159606"/>
		<updated>2024-11-15T01:54:10Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2450. Refactor assignments_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2451. Reimplement feedback_response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb (Phase 2 - Design Document)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2457. GitHub metrics integration]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2458. User management and users table]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI and Backend for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2472. Reimplement responses_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2473. Reimplement sign up topic.rb as project topic.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2474. Reimplement student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2476. Reimplement student_teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2477. Reimplement suggestion_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2479. Reimplement teams_users_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2484. Reimplement participants_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2485. Allow reviewers to bid on what to review]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2486.Reimplement deadline_rights and deadline_types]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2487. Reimplement authorization_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2489. Create a UI for Assignment Edit page &amp;quot;Etc&amp;quot; tab in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2491.UI for View assignments in Courses view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2492. UI for View submissions/assign grades (except heatgrid)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2493. UI for Assign Reviewers]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2494. UI for Report Review for Assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159605</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=159605"/>
		<updated>2024-11-15T01:53:42Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2450. Refactor assignments_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2451. Reimplement feedback_response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb (Phase 2 - Design Document)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2457. GitHub metrics integration]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2458. User management and users table]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI and Backend for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2472. Reimplement responses_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2473. Reimplement sign up topic.rb as project topic.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2474. Reimplement student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2476. Reimplement student_teams_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2477. Reimplement suggestion_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2479. Reimplement teams_users_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2484. Reimplement participants_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2485. Allow reviewers to bid on what to review]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2486. Reimplement deadline_rights and deadline_types]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2487. Reimplement authorization_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2488 Reimplementation of Add TA to course]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2489. Create a UI for Assignment Edit page &amp;quot;Etc&amp;quot; tab in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2491.UI for View assignments in Courses view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2492. UI for View submissions/assign grades (except heatgrid)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2493. UI for Assign Reviewers]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2494. UI for Report Review for Assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=159604</id>
		<title>CSC/ECE 517 Fall 2024 - E2486.Reimplement deadline rights and deadline types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2486.Reimplement_deadline_rights_and_deadline_types&amp;diff=159604"/>
		<updated>2024-11-15T01:49:29Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: Created page with &amp;quot;=Project 4 Design Doc= ==Issues== 1. '''Determining Late Submissions:''' * There is a need to calculate whether submissions or reviews are late based on the due dates. * '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.  2. '''Handling Late Team Formation:''' * Teams that form after the due date should incur a penalty. * '''Issue:''' Team formation dates may not be explicitly tracked in the...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Project 4 Design Doc=&lt;br /&gt;
==Issues==&lt;br /&gt;
1. '''Determining Late Submissions:'''&lt;br /&gt;
* There is a need to calculate whether submissions or reviews are late based on the due dates.&lt;br /&gt;
* '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.&lt;br /&gt;
&lt;br /&gt;
2. '''Handling Late Team Formation:'''&lt;br /&gt;
* Teams that form after the due date should incur a penalty.&lt;br /&gt;
* '''Issue:''' Team formation dates may not be explicitly tracked in the current system, or if they are, they are not used for penalty calculation.&lt;br /&gt;
&lt;br /&gt;
3. '''Handling Review Penalties:'''&lt;br /&gt;
* Participants who fail to complete reviews on time should incur a penalty as well.&lt;br /&gt;
* '''Issue:''' Reviews are often tied to the response maps or individual participants, so there's a challenge in ensuring penalties are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* The penalty calculation should be easily extensible, and transparent for debugging.&lt;br /&gt;
* '''Issue:''' Penalties may need to be applied in multiple places within the codebase, but should be kept modular and readable.&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* The code should remain maintainable as penalties could apply to more parts of the application in the future.&lt;br /&gt;
* '''Issue:''' Repeating penalty logic across models may lead to code duplication, increasing maintenance cost.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solutions==&lt;br /&gt;
A. '''Introduction of a PenaltyCalculator Mixin'''&lt;br /&gt;
* '''Solution:''' A new module `PenaltyCalculator` will be created to handle the penalty calculations. This module will contain methods for calculating submission, review, and team formation penalties.&lt;br /&gt;
* '''Benefit:''' It makes the penalty calculation logic reusable, keeps the code DRY, and ensures the logic is centralized.&lt;br /&gt;
&lt;br /&gt;
B. '''Tracking Submission Dates'''&lt;br /&gt;
* '''Solution:''' Ensure that submission dates are explicitly tracked in the `Submission` model. Add a method to check if a submission is late based on the due date.&lt;br /&gt;
* '''Benefit:''' Provides a straightforward way to identify late submissions and apply penalties accordingly.&lt;br /&gt;
&lt;br /&gt;
C. '''Tracking Team Formation Dates'''&lt;br /&gt;
* '''Solution:''' Use the team formation date in the `Team` model to track when a team is formed. Use this date to calculate penalties for late team formation.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late team formation are applied consistently and accurately.&lt;br /&gt;
&lt;br /&gt;
D. '''Handling Review Penalties'''&lt;br /&gt;
* '''Solution:''' Extend the `PenaltyCalculator` mixin to include methods for calculating penalties for late reviews. Ensure that review deadlines are tracked and used in penalty calculations.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late reviews are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
E. '''Extensible Penalty Application'''&lt;br /&gt;
* '''Solution:''' Design the `PenaltyCalculator` mixin to be easily extensible, allowing new types of penalties to be added in the future. Use clear and transparent methods for debugging.&lt;br /&gt;
* '''Benefit:''' Keeps the penalty calculation logic modular and readable, making it easier to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
F. '''Code Maintainability and Readability'''&lt;br /&gt;
* '''Solution:''' Centralize the penalty calculation logic in the `PenaltyCalculator` mixin to avoid code duplication. Ensure that the mixin is included in relevant models where penalties need to be applied.&lt;br /&gt;
* '''Benefit:''' Reduces code duplication, making the codebase easier to maintain and ensuring that penalty logic is consistent across the application.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:PenaltyMixinUML.JPG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation of PenaltyCalculator Module==&lt;br /&gt;
    module PenaltyCalculator&lt;br /&gt;
      def calculate_penalty(submission_date, due_date, penalty_rate)&lt;br /&gt;
        return 0 if submission_date &amp;lt;= due_date&lt;br /&gt;
        days_late = (submission_date.to_date - due_date.to_date).to_i&lt;br /&gt;
        penalty = days_late * penalty_rate&lt;br /&gt;
        penalty&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
==Summary of Proposed File Changes==&lt;br /&gt;
&lt;br /&gt;
* app/lib/penalty_calculator.rb (new file)&lt;br /&gt;
* app/models/assignment.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/submission.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/participant.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* app/models/team.rb (modify to include mixin and penalty calculation method)&lt;br /&gt;
* config/application.rb (modify to ensure lib directory is autoloaded)&lt;br /&gt;
* spec/lib/penalty_calculator_spec.rb (new file for unit tests)&lt;br /&gt;
* spec/models/assignment_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/submission_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/participant_spec.rb (modify to include tests for penalty calculation)&lt;br /&gt;
* spec/models/team_spec.rb (modify to include tests for penalty calculation)&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159478</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=159478"/>
		<updated>2024-11-13T05:02:53Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project 4 Design Doc=&lt;br /&gt;
==Issues==&lt;br /&gt;
1. '''Determining Late Submissions:'''&lt;br /&gt;
* There is a need to calculate whether submissions or reviews are late based on the due dates.&lt;br /&gt;
* '''Issue:''' The current system does not have a straightforward way to identify late submissions or track submission dates easily.&lt;br /&gt;
&lt;br /&gt;
2. '''Handling Late Team Formation:'''&lt;br /&gt;
* Teams that form after the due date should incur a penalty.&lt;br /&gt;
* '''Issue:''' Team formation dates may not be explicitly tracked in the current system, or if they are, they are not used for penalty calculation.&lt;br /&gt;
&lt;br /&gt;
3. '''Handling Review Penalties:'''&lt;br /&gt;
* Participants who fail to complete reviews on time should incur a penalty as well.&lt;br /&gt;
* '''Issue:''' Reviews are often tied to the response maps or individual participants, so there's a challenge in ensuring penalties are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
4. '''Penalty Application:'''&lt;br /&gt;
* The penalty calculation should be easily extensible, and transparent for debugging.&lt;br /&gt;
* '''Issue:''' Penalties may need to be applied in multiple places within the codebase, but should be kept modular and readable.&lt;br /&gt;
&lt;br /&gt;
5. '''Code Maintainability and Readability:'''&lt;br /&gt;
* The code should remain maintainable as penalties could apply to more parts of the application in the future.&lt;br /&gt;
* '''Issue:''' Repeating penalty logic across models may lead to code duplication, increasing maintenance cost.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solutions==&lt;br /&gt;
A. '''Introduction of a PenaltyCalculator Mixin'''&lt;br /&gt;
* '''Solution:''' A new module `PenaltyCalculator` will be created to handle the penalty calculations. This module will contain methods for calculating submission, review, and team formation penalties.&lt;br /&gt;
* '''Benefit:''' It makes the penalty calculation logic reusable, keeps the code DRY, and ensures the logic is centralized.&lt;br /&gt;
&lt;br /&gt;
B. '''Tracking Submission Dates'''&lt;br /&gt;
* '''Solution:''' Ensure that submission dates are explicitly tracked in the `Submission` model. Add a method to check if a submission is late based on the due date.&lt;br /&gt;
* '''Benefit:''' Provides a straightforward way to identify late submissions and apply penalties accordingly.&lt;br /&gt;
&lt;br /&gt;
C. '''Tracking Team Formation Dates'''&lt;br /&gt;
* '''Solution:''' Use the team formation date in the `Team` model to track when a team is formed. Use this date to calculate penalties for late team formation.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late team formation are applied consistently and accurately.&lt;br /&gt;
&lt;br /&gt;
D. '''Handling Review Penalties'''&lt;br /&gt;
* '''Solution:''' Extend the `PenaltyCalculator` mixin to include methods for calculating penalties for late reviews. Ensure that review deadlines are tracked and used in penalty calculations.&lt;br /&gt;
* '''Benefit:''' Ensures that penalties for late reviews are applied consistently across different models.&lt;br /&gt;
&lt;br /&gt;
E. '''Extensible Penalty Application'''&lt;br /&gt;
* '''Solution:''' Design the `PenaltyCalculator` mixin to be easily extensible, allowing new types of penalties to be added in the future. Use clear and transparent methods for debugging.&lt;br /&gt;
* '''Benefit:''' Keeps the penalty calculation logic modular and readable, making it easier to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
F. '''Code Maintainability and Readability'''&lt;br /&gt;
* '''Solution:''' Centralize the penalty calculation logic in the `PenaltyCalculator` mixin to avoid code duplication. Ensure that the mixin is included in relevant models where penalties need to be applied.&lt;br /&gt;
* '''Benefit:''' Reduces code duplication, making the codebase easier to maintain and ensuring that penalty logic is consistent across the application.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:PenaltyMixinUML.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test cases:&lt;br /&gt;
&lt;br /&gt;
[[File:Copy_due_date_test.jpeg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Sort_unit_test.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:PenaltyMixinUML.JPG&amp;diff=159476</id>
		<title>File:PenaltyMixinUML.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:PenaltyMixinUML.JPG&amp;diff=159476"/>
		<updated>2024-11-13T04:57:05Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158631</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158631"/>
		<updated>2024-10-31T03:22:10Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Testing Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test cases:&lt;br /&gt;
&lt;br /&gt;
[[File:Copy_due_date_test.jpeg]]&lt;br /&gt;
&lt;br /&gt;
[[File:Sort_unit_test.JPG]]&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Sort_unit_test.JPG&amp;diff=158630</id>
		<title>File:Sort unit test.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Sort_unit_test.JPG&amp;diff=158630"/>
		<updated>2024-10-31T03:18:47Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: Unit test for DueDate.sort_due_dates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Unit test for DueDate.sort_due_dates&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Copy_due_date_test.jpeg&amp;diff=158629</id>
		<title>File:Copy due date test.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Copy_due_date_test.jpeg&amp;diff=158629"/>
		<updated>2024-10-31T03:18:11Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: Unit test for due_date.copy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Unit test for due_date.copy&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158628</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158628"/>
		<updated>2024-10-31T03:14:14Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Other changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158627</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158627"/>
		<updated>2024-10-31T03:13:58Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Design Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
* Some attributes of the old model were determined to not be reused in the new implementation. However, these attributes need to be present for backward compatibility, so we removed any references to them but left their associated column within our table.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158626</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158626"/>
		<updated>2024-10-31T03:11:04Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Other changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
We did not reimplement these methods as they were unused and therefore obsolete&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Obsolete method !! Description &lt;br /&gt;
|- &lt;br /&gt;
|self.teammate_review_allowed || Unnecessary method now that teammate_review_allowed is an attr_accessor&lt;br /&gt;
|-&lt;br /&gt;
|self.done_in_assignment_round || This determined the round that the due date was used in. Unnecessary as we can just grab the deadline_type_id directly from a due_date instance.&lt;br /&gt;
|-&lt;br /&gt;
|set_flag || Simple setter of the flag attribute. Not reimplemented as flag had not been used since 2015 and no one was really sure what it was used for.&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158625</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158625"/>
		<updated>2024-10-31T03:02:59Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Design Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* We had one overarching goal with this reimplementation: clean up the old bloated model. To do so, we broke down functionality into two separate buckets - code that was overly complex and/or wordy, which could be reused after some basic cleanup and simplification; and code that was obsolete and therefore could be removed entirely with the reimplementation&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158624</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158624"/>
		<updated>2024-10-31T02:57:49Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158623</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158623"/>
		<updated>2024-10-31T02:57:29Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Reimplemented Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;DueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While most of the methods in the original model were functionally correct, we saw areas of possible improvement both in readability and complexity. We also removed a few methods that were unnecessary after reimplementation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  due_at_is_valid_datetime || Simple validation that due_at is a datetime and not some other data type.&lt;br /&gt;
|-&lt;br /&gt;
|  self.sort_due_dates || Sorts the due dates by earliest to latest.&lt;br /&gt;
|-&lt;br /&gt;
|  self.fetch_due_dates || Fetches all the due dates for the assignment or topic, then returns the sorted list of due dates.&lt;br /&gt;
|-&lt;br /&gt;
|  self.any_future_due_dates? || Method that returns a boolean of whether there are any upcoming due dates left in the assignment or topic.&lt;br /&gt;
|-&lt;br /&gt;
|  self.next_due_date || Calls the fetcher to retrieve all the due dates for an assignment, then returns the next upcoming due date.&lt;br /&gt;
|-&lt;br /&gt;
|  set || Instance method used to update a due date's deadline type, assignment, and round.&lt;br /&gt;
|-&lt;br /&gt;
|  copy || Instance method to copy all the due dates from one assignment or topic to another.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;TopicDueDate&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
!  Reimplemented method !! Description &lt;br /&gt;
|-  &lt;br /&gt;
|  self.next_due_date || Overloaded super method to first look for any upcoming topic due dates, and return the next one if so. If there are not any, it returns the next due date for the topic's assignment instead.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== New and enhanced methods ==&lt;br /&gt;
The old code had issues with redundancy, lengthy methods, and a lack of clear separation between different pieces of logic. The introduction of these new helper methods addresses these concerns. Here's an overview of the new methods and the rationale behind their implementation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! New method !! Purpose !! Rationale !! Commit&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158620</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=158620"/>
		<updated>2024-10-31T02:22:48Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
== New and enhanced methods ==&lt;br /&gt;
The old code had issues with redundancy, lengthy methods, and a lack of clear separation between different pieces of logic. The introduction of these new helper methods addresses these concerns. Here's an overview of the new methods and the rationale behind their implementation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! New method !! Purpose !! Rationale !! Commit&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-back-end/pull/129&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157832</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157832"/>
		<updated>2024-10-29T23:09:08Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=157830</id>
		<title>CSC/ECE 517 Fall 2024 - E2468. Reimplement due date</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2468._Reimplement_due_date&amp;diff=157830"/>
		<updated>2024-10-29T23:06:09Z</updated>

		<summary type="html">&lt;p&gt;Pechopel: Created page with &amp;quot;=About Expertiza= Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.  =Issues with previous Functionality= * &amp;lt;b&amp;gt;Outda...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=About Expertiza=&lt;br /&gt;
Expertiza is an open-source project built using Ruby on Rails. It provides a platform for instructors and students to manage, submit, and evaluate assignments and projects. Instructors can create, edit, and grade assignments, while students can collaborate in teams, submit their work, and review peers' submissions. Expertiza supports submission across various document types, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* &amp;lt;b&amp;gt;Outdated Code:&amp;lt;/b&amp;gt; The original implementation seems to be very old code that does not utilize features that are standard in current ruby versions. Updating this code improves maintainability and code clarity. A prime example is the use of a flag attribute, which apparently has not been used in nearly a decade.&lt;br /&gt;
* &amp;lt;b&amp;gt;Readability:&amp;lt;/b&amp;gt; The original due_date.rb had become quite bloated and messy, with overly complex methods that were difficult to read. An example of this is self.get_next_due_date. This could hamper future development as understanding exactly what due dates can and cannot do could become difficult due to unclear code.&lt;br /&gt;
* &amp;lt;b&amp;gt;Single-Responsibility Principle Violations:&amp;lt;/b&amp;gt; The original implementation violated several SOLID principles, primarily violations around the Single-Responsibility Principle. These issues create difficulty in maintainability as code may need to be updated in multiple places that each do the same thing.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reimplemented Methods==&lt;br /&gt;
&lt;br /&gt;
== New and enhanced methods ==&lt;br /&gt;
The old code had issues with redundancy, lengthy methods, and a lack of clear separation between different pieces of logic. The introduction of these new helper methods addresses these concerns. Here's an overview of the new methods and the rationale behind their implementation:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&lt;br /&gt;
! &amp;amp;nbsp;#&amp;amp;nbsp; !! New method !! Purpose !! Rationale !! Commit&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other changes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing Plan=&lt;br /&gt;
We primarily tested using automated testing through RSpec. Since due dates are a relatively self-contained structure, RSpec testing was more than sufficient for covering all testing scenarios. Here are some of our test classes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/akuldevali/reimplementation-back-end&lt;br /&gt;
* '''Pull Request:''' TODO&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor:&amp;lt;/b&amp;gt; Dr. Ed Gehringer - efg@ncsu.edu&lt;br /&gt;
* Akul Devali - devali@ncsu.edu&lt;br /&gt;
* Pete Chopelas - pechopel@ncsu.edu&lt;br /&gt;
* Snehil Behar - sbehar@ncsu.edu&lt;/div&gt;</summary>
		<author><name>Pechopel</name></author>
	</entry>
</feed>