ValidationAttempt.cs 2.19 KB
Newer Older
Nathan Bean's avatar
Nathan Bean committed
1
2
using System;
using System.Collections.Generic;
3
using System.ComponentModel.DataAnnotations.Schema;
Nathan Bean's avatar
Nathan Bean committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.Linq;
using System.Threading.Tasks;

namespace KSU.CS.Pendant.Server.Models
{
    /// <summary>
    /// A class representing an attempt by a student 
    /// to validate thier assignment solution
    /// </summary>
    public class ValidationAttempt
    {
        /// <summary>The database primary key</summary>
        public int ID { get; set; }

        /// <summary>
        /// The user who made the attempt
        /// </summary>
        public User User { get; set; }

        /// <summary>
        /// The assignment this attempt is for
        /// </summary>
        public Assignment Assignment { get; set; }

        /// <summary>
        /// The date and time the attempt was made
        /// </summary>
        public DateTime DateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// The total number of issues encountered in the attempt
        /// </summary>
        public int IssueCount => StructuralIssues.Count + FunctionalIssues.Count + DesignIssues.Count + StyleIssues.Count;

        /// <summary>
        /// The structural issues encountered in the attempt
        /// </summary>
        public List<ValidationIssue> StructuralIssues { get; set; } = new List<ValidationIssue>();

        /// <summary>
        /// The functional issues encountered in the attempt
        /// </summary>
        public List<ValidationIssue> FunctionalIssues { get; set; } = new List<ValidationIssue>();

        /// <summary>
        /// The design issues encountered in the attempt
        /// </summary>
        public List<ValidationIssue> DesignIssues { get; set; } = new List<ValidationIssue>();

        /// <summary>
        /// The style issues encountered in the attempt
        /// </summary>
        public List<ValidationIssue> StyleIssues { get; set; } = new List<ValidationIssue>();

        /// <summary>
        /// The location of the student's work in the file system
        /// </summary>
        public string SolutionPath { get; set; }
62
63
64
65
66
67

        [NotMapped]
        public string RepoUrl { get; set; }

        [NotMapped]
        public string CommitIdentifier { get; set; }
Nathan Bean's avatar
Nathan Bean committed
68
69
    }
}