Example #1
0
        public override void Check(Submission other)
        {
            // Check if this is disabled
            if (!_submission.Config.CheckContent ||
                !other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            // Create local copies of content to avoid colllisons, and trim it
            string originalContent = _submission.Content;

            if (_submission.ContentLength > _submission.Config.CheckContentMaximumLength)
            {
                originalContent = originalContent.Substring(0, _submission.Config.CheckContentMaximumLength);
            }

            string otherContent = other.Content;

            if (other.ContentLength > _submission.Config.CheckContentMaximumLength)
            {
                otherContent = otherContent.Substring(0, _submission.Config.CheckContentMaximumLength);
            }


            double contentComparison = Compare.CalculateSimilarity(originalContent, otherContent);

            if (contentComparison >= _submission.Config.CheckContentThreshold)
            {
                Flag.AddSimilarSubmission(other, contentComparison, string.Empty);
            }
        }
Example #2
0
        public override void Check(Submission other)
        {
            if (!other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            if (_submission.ContentHash != string.Empty && _submission.ContentHash == other.ContentHash)
            {
                Flag.AddSimilarSubmission(other, 1, other.ContentHash);
            }
        }
        public override void Check(Submission other)
        {
            // Check if we're doing this check
            if (!_submission.Config.CheckMetaDateLastPrinted ||
                !other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            // Evaluate check
            if (_submission.MetaDateLastPrinted != DateTime.MinValue &&
                _submission.MetaDateLastPrinted == other.MetaDateLastPrinted)
            {
                Flag.AddSimilarSubmission(other, 1, other.MetaDateLastPrinted.ToString());
            }
        }
Example #4
0
        public override void Check(Submission other)
        {
            // Check if we're doing this check
            if (!_submission.Config.CheckMetaCreator ||
                !other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            // Evaluate check
            if (_submission.MetaCreator != string.Empty &&
                !_submission.Config.SharedIgnoredUsernames.Contains(_submission.MetaCreator) &&
                _submission.MetaCreator == other.MetaCreator)
            {
                Flag.AddSimilarSubmission(other, 1, other.MetaCreator);
            }
        }
Example #5
0
        public override void Check(Submission other)
        {
            // Check if we're doing this check
            if (!_submission.Config.CheckFileName ||
                !other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            // Check if the other has the same capability
//            other.Processor.GetCheckTypes()

            // TODO : Remove copy parts (1) / copy
            // TODO: 2018.2

            // Calculate difference
            double fileNameComparison = Compare.CalculateSimilarity(_submission.FileName, other.FileName);

            // Evaluate check
            if (fileNameComparison > _submission.Config.CheckFileNameThreshold)
            {
                Flag.AddSimilarSubmission(other, fileNameComparison, other.FileName);
            }
        }
Example #6
0
        public override void Check(Submission other)
        {
            // Check if we're doing this check
            if (!_submission.Config.CheckMetaLastModifiedBy ||
                !other.Processor.GetCheckTypes().HasFlag(GetType()))
            {
                return;
            }

            // Evaluate check
            if (_submission.MetaLastModifiedBy != string.Empty &&
                !_submission.Config.SharedIgnoredUsernames.Contains(_submission.MetaLastModifiedBy))
            {
                // Check if the last modified by are the same, but also if the creator of the other document is a match
                if (_submission.MetaLastModifiedBy == other.MetaLastModifiedBy)
                {
                    Flag.AddSimilarSubmission(other, 1, other.MetaLastModifiedBy);
                }
                else if (_submission.MetaLastModifiedBy == other.MetaCreator)
                {
                    Flag.AddSimilarSubmission(other, 1, other.MetaCreator + "[Creator]");
                }
            }
        }