Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions GraphLabs.Backend.Domain/GraphLabs.Backend.Domain.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можешь этот файл в гитигнор отправить?

<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
2 changes: 2 additions & 0 deletions GraphLabs.Backend.Domain/Student.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ public class Student : User
public virtual string Group { get; set; }

public virtual ICollection<TaskVariantLog> Logs { get; set; }

public virtual ICollection<TestResult> TestResults { get; set; }
}
}
19 changes: 19 additions & 0 deletions GraphLabs.Backend.Domain/Subject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GraphLabs.Backend.Domain
{
public class Subject
{
public virtual long Id { get; set; }

public virtual string Name { get; set; }

public virtual string Description { get; set; }

public virtual ICollection<TaskModule> TaskModules { get; set; }

public virtual ICollection<TestQuestion> TestQuestions { get; set; }
}
}
2 changes: 2 additions & 0 deletions GraphLabs.Backend.Domain/TaskModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class TaskModule
public virtual string Description { get; set; }

public virtual string Version { get; set; }

public virtual Subject Subject { get; set; }

public virtual ICollection<TaskVariant> Variants { get; set; }
}
Expand Down
17 changes: 17 additions & 0 deletions GraphLabs.Backend.Domain/TestAnswer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GraphLabs.Backend.Domain
{
public class TestAnswer
{
public virtual long Id { get; set; }

public virtual string Answer { get; set; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это для открытого вопроса, а для вопроса с выбором вариантов не будем ссылку на выбранный ответ делать?


public virtual bool IsRight { get; set; }

public virtual TestQuestion Question { get; set; }
}
}
25 changes: 25 additions & 0 deletions GraphLabs.Backend.Domain/TestQuestion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GraphLabs.Backend.Domain
{
public class TestQuestion
{
public virtual long Id { get; set; }

public virtual string Description { get; set; }

public enum Difficulty : int { Three, Four, Five }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для перечислений (вообще всех) нужно воспользоваться старым дедовским синтаксисом. Объявляем сначала в отдельном файле новый энам

public enum Mark 
{
  Two = 2, 
  Three =3, 
  Four =4, 
  Five = 5
}

, а потом где нужно его используем (public Mark Difficulty)

Это облегчит дальнейшее переиспользование этого типа и избавит от ошибок (например, на этой строке забыли цифровые значения присвоить)


public virtual int MaxScore { get; set; }

public virtual string ImageURL { get; set; }

public virtual TestResult TestResult { get; set; }

public virtual Subject Subject { get; set; }

public virtual ICollection<TestAnswer> Answers { get; set; }
}
}
23 changes: 23 additions & 0 deletions GraphLabs.Backend.Domain/TestResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GraphLabs.Backend.Domain
{
public class TestResult
{
public virtual long Id { get; set; }

public virtual DateTime DateTime { get; set; }

public virtual int Mark { get; set; }

public enum MarkEU : int { F, E, D, C, B, A }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тоже отдельный enum завести MarkEu


public enum MarkRU : int { Two = 2, Three = 3, Four = 4, Five = 5 }

public virtual Student Student { get; set; }

public virtual ICollection<TestQuestion> Questions { get; set; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вопрос. А всё-таки TestResult это ответ на один вопрос или на все вопросы?
Потому что на картинке в этом месте вижу несоответствие между направлением связи и проставленными кардинальностями (1 N)

}
}
2 changes: 2 additions & 0 deletions GraphLabs.Backend.Domain/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public abstract class User
public virtual byte[] PasswordHash { get; set; }

public virtual byte[] PasswordSalt { get; set; }

public virtual string Token { get; set; }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А вот это что такое и для чего?

}
}