Exemple #1
0
 def _message_step(self):
     # Send the work to the reviewers
     # Note that we still do this even if send is false because
     # the messenger will print out the messages rather than sending them
     self.messenger = PeerReviewInvitationMessenger(self.unit,
                                                    self.studentRepo,
                                                    self.work_repo,
                                                    self.statusRepos)
     # NB, we don't use associationRepo.data because we only
     # want to send to people who are newly assigned
     self.messenger.notify(self.associations, self.send)
     # self.messenger.notify( self.associationRepo.data, self.send )
     #  todo Want some way of tracking if messages fail to send so can resend
     # Log the run
     msg = "Created {} peer review assignments \n {}".format(
         len(self.associations), self.associations)
     RunLogger.log_reviews_assigned(self.activity_notifying_about, msg)
Exemple #2
0
    def run(self, **kwargs):
        """
        Loads content assignments, assigns reviewers, and sends formatted
        work to reviewer
        Possible kwargs:
            only_new=False, Probably not used
            rest_timeout=5 Number of seconds to rest_timeout for canvas to generate report
        :return:
        """
        try:
            self._load_step(**kwargs)

            self._assign_step()

            self._message_step()

        except NoNewSubmissions:
            # Check if new submitters, bail if not
            print("No new submissions")
            # todo Log run failure
            RunLogger.log_no_submissions(self.unit.initial_work)
            if CanvasHacks.testglobals.TEST:
                # Reraise so can see what happened for tests
                raise NoNewSubmissions

        except AllAssigned as e:
            # Folks already assigned to review
            # have somehow gotten past the new submissions filter
            # This could be due to them resubmitting late
            print("New submitters but everyone already assigned")
            # print( e.submitters )
            if CanvasHacks.testglobals.TEST:
                # Reraise so can see what happened for tests
                raise AllAssigned(e.submitters)

        except NoAvailablePartner as e:
            # We will probably want to notify the student that they
            # have had their work noticed, but they are now waiting for
            # a partner
            # todo Notify student that they are waiting
            print("1 student has submitted and has no partner "
                  )  #, e.submitters )
            if CanvasHacks.testglobals.TEST:
                # Reraise so can see what happened for tests
                raise NoAvailablePartner(e.submitters)
    def _message_step(self):
        """
        Handle sending the results of the review to the original author
        :return:
        """
        self.messenger = FeedbackFromDiscussionReviewMessenger(
            self.unit, self.studentRepo, self.work_repo, self.statusRepos)

        sent = self.messenger.notify(self.associations, self.send)
        self.display_manager.number_sent = sent

        # Log the run
        msg = "Sent {} peer review results \n {}".format(
            len(self.associations), self.associations)
        # Note we are distributing the material for the metareview, that's
        # why we're using that activity_inviting_to_complete.
        RunLogger.log_review_feedback_distributed(
            self.activity_notifying_about, msg)
Exemple #4
0
    def _message_step( self ):
        print( "Going to send metareview results for {} students".format( len( self.associations ) ) )

        # Send
        self.messenger = FeedbackFromMetareviewMessenger( self.unit,
                                                          self.studentRepo,
                                                          self.work_repo,
                                                          self.statusRepos )
        self.messenger.notify( self.associations, self.send )
        # Log the run
        msg = "Sent {} metareview results to authors".format( len( self.associations ) )
        print( msg )

        lmsg = "{} \n {}".format( msg, self.associations )

        # Note we are distributing the material for the metareview, that's
        # why we're using that activity_inviting_to_complete.
        RunLogger.log_metareview_feedback_distributed( self.unit.metareview, lmsg )
Exemple #5
0
    def _message_step(self):
        # Handle sending the results of the review to the original author
        # so they can do the metareview
        self.messenger = MetareviewInvitationMessenger(self.unit,
                                                       self.studentRepo,
                                                       self.work_repo,
                                                       self.statusRepos)

        self.messenger.notify(self.associations, self.send)

        # Log the run
        msg = "Sent {} peer review results to authors".format(
            len(self.associations))
        print(msg)

        lmsg = "{} \n {}".format(msg, self.associations)
        # Note we are distributing the material for the metareview, that's
        # why we're using that activity_inviting_to_complete.
        RunLogger.log_review_feedback_distributed(self.unit.metareview, lmsg)
    def run(self, **kwargs):
        """
        Retrieves submitted reviews and sends them to the authors
        along with instructions for metareview
        Possible kwarg parameters include:
            only_new=False
            rest_timeout=5
        :return:
        """
        try:
            self._load_step(**kwargs)

            self._assign_step()

            self._message_step()

        except NoNewSubmissions:
            # Check if new submitters, bail if not
            print("No new submissions")
            RunLogger.log_no_submissions(self.activity)

        except Exception as e:
            print(e)