CSC/ECE 517 Fall 2021 - E2142. Improve e-mail notifications: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 25: Line 25:


According to the current Code scenario on the beta branch '''''if the deadline has passed, a student(participant) cannot make new submissions'''''. So, automatically if the participant doe not make a new submission then the reviewer wont receive an email. So this issue does not really exist by the virtue of the state of the system.
According to the current Code scenario on the beta branch '''''if the deadline has passed, a student(participant) cannot make new submissions'''''. So, automatically if the participant doe not make a new submission then the reviewer wont receive an email. So this issue does not really exist by the virtue of the state of the system.
the stack trace for the check if the submission is allowed or not is as follows -
assignment.rb
<pre>
def submission_allowed(topic_id = nil)
    check_condition('submission_allowed_id', topic_id)
end
</pre>
assignment.rb
<pre>
  def check_condition(column, topic_id = nil)
    next_due_date = DueDate.get_next_due_date(self.id, topic_id)
    return false if next_due_date.nil?
    right_id = next_due_date.send column
    right = DeadlineRight.find(right_id)
    right && (right.name == 'OK' || right.name == 'Late')
  end
</pre>
due_date.rb
<pre>
    def self.get_next_due_date(assignment_id, topic_id = nil)
    if Assignment.find(assignment_id).staggered_deadline?
      next_due_date = TopicDueDate.find_by(['parent_id = ? and due_at >= ?', topic_id, Time.zone.now])
      # if certion TopicDueDate is not exist, we should query next corresponding AssignmentDueDate.
      # eg. Time.now is 08/28/2016
      # One topic uses following deadlines:
      # TopicDueDate      08/01/2016
      # TopicDueDate      08/02/2016
      # TopicDueDate      08/03/2016
      # AssignmentDueDate 09/04/2016
      # In this case, we cannot find due_at later than Time.now in TopicDueDate.
      # So we should find next corrsponding AssignmentDueDate, starting with the 4th one, not the 1st one!
      if next_due_date.nil?
        topic_due_date_size = TopicDueDate.where(parent_id: topic_id).size
        following_assignment_due_dates = AssignmentDueDate.where(parent_id: assignment_id)[topic_due_date_size..-1]
        unless following_assignment_due_dates.nil?
          following_assignment_due_dates.each do |assignment_due_date|
            if assignment_due_date.due_at >= Time.zone.now
              next_due_date = assignment_due_date
              break
            end
          end
        end
      end
    else
      next_due_date = AssignmentDueDate.find_by(['parent_id = ? && due_at >= ?', assignment_id, Time.zone.now])
    end
    next_due_date
  end
</pre>
So this is issue is resolved by the state of the system itself.
'''''BUT Surprisingly on beta branch Reviewers aren't getting any emails at all'''''


==Brief Introduction==
==Brief Introduction==

Revision as of 20:49, 19 October 2021

E2142. Improve e-mail notifications

Work in progress

This project is ongoing, and this page will be updated live.


Issue - Don't send email to reviewers for a new submission after the review deadline has passed

Pre conditions - There is an assignment, a student as a participant, a participant as a reviewer who is reviewing the this particular assignment - a review is made for a submission by the student - review deadline has passed - the student is allowed to submit after the review deadline has passed

Expected Behavior

Exact issue stating the expected behavior can be found at https://github.com/expertiza/expertiza/issues/345 - "Evidently, if a submission is revised after review, the system e-mails the reviewer saying to revise the review. This is just fine ... except if the last round of review has been completed. The message telling reviewers to revise their reviews should not be sent after the last review deadline has passed."

So basically, When the student makes a new submission after the LAST review deadline has passed. The reviewer should not receive an email, asking the reviewer to update the review according to the new submission.

Actual Behavior

According to the current Code scenario on the beta branch if the deadline has passed, a student(participant) cannot make new submissions. So, automatically if the participant doe not make a new submission then the reviewer wont receive an email. So this issue does not really exist by the virtue of the state of the system. the stack trace for the check if the submission is allowed or not is as follows - assignment.rb

def submission_allowed(topic_id = nil)
    check_condition('submission_allowed_id', topic_id)
end

assignment.rb

  def check_condition(column, topic_id = nil)
    next_due_date = DueDate.get_next_due_date(self.id, topic_id)
    return false if next_due_date.nil?
    right_id = next_due_date.send column
    right = DeadlineRight.find(right_id)
    right && (right.name == 'OK' || right.name == 'Late')
  end

due_date.rb

    def self.get_next_due_date(assignment_id, topic_id = nil)
    if Assignment.find(assignment_id).staggered_deadline?
      next_due_date = TopicDueDate.find_by(['parent_id = ? and due_at >= ?', topic_id, Time.zone.now])
      # if certion TopicDueDate is not exist, we should query next corresponding AssignmentDueDate.
      # eg. Time.now is 08/28/2016
      # One topic uses following deadlines:
      # TopicDueDate      08/01/2016
      # TopicDueDate      08/02/2016
      # TopicDueDate      08/03/2016
      # AssignmentDueDate 09/04/2016
      # In this case, we cannot find due_at later than Time.now in TopicDueDate.
      # So we should find next corrsponding AssignmentDueDate, starting with the 4th one, not the 1st one!
      if next_due_date.nil?
        topic_due_date_size = TopicDueDate.where(parent_id: topic_id).size
        following_assignment_due_dates = AssignmentDueDate.where(parent_id: assignment_id)[topic_due_date_size..-1]
        unless following_assignment_due_dates.nil?
          following_assignment_due_dates.each do |assignment_due_date|
            if assignment_due_date.due_at >= Time.zone.now
              next_due_date = assignment_due_date
              break
            end
          end
        end
      end
    else
      next_due_date = AssignmentDueDate.find_by(['parent_id = ? && due_at >= ?', assignment_id, Time.zone.now])
    end
    next_due_date
  end

So this is issue is resolved by the state of the system itself. BUT Surprisingly on beta branch Reviewers aren't getting any emails at all

Brief Introduction