Repository navigation
Expand file tree
/
Copy pathCourseResource.cs
More file actions
91 lines (76 loc) · 2.98 KB
/
Copy pathCourseResource.cs
File metadata and controls
91 lines (76 loc) · 2.98 KB
1
2
3
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
namespace Tutor.Core.Models;
/// <summary>
/// Represents a learning resource (document, text, etc.) that can be added to a course.
/// </summary>
public class CourseResource
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Title { get; set; } = "";
public string Author { get; set; } = "";
public string Year { get; set; } = "";
public string Description { get; set; } = "";
/// <summary>
/// Original content as uploaded/pasted.
/// </summary>
public string Content { get; set; } = "";
/// <summary>
/// AI-formatted version of the content (if processed).
/// </summary>
public string? FormattedContent { get; set; }
public ResourceType Type { get; set; } = ResourceType.Text;
public string FileName { get; set; } = "";
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
/// <summary>
/// Whether this resource has been processed (formatted, concepts extracted).
/// </summary>
public bool IsProcessed { get; set; }
/// <summary>
/// ID of the ConceptMap generated from this resource.
/// Each resource generates its own independent ConceptMap.
/// Null if no ConceptMap has been built yet.
/// </summary>
public string? ConceptMapId { get; set; }
/// <summary>
/// Current status of the ConceptMap generation for this resource.
/// </summary>
public ConceptMapStatus ConceptMapStatus { get; set; } = ConceptMapStatus.NotStarted;
/// <summary>
/// Whether this resource has a ConceptMap built.
/// </summary>
public bool HasConceptMap => !string.IsNullOrEmpty(ConceptMapId)
&& ConceptMapStatus == ConceptMapStatus.Ready;
/// <summary>
/// Gets the best available content (formatted if available, otherwise original).
/// </summary>
public string GetEffectiveContent() => FormattedContent ?? Content;
// Orphan Linking Override Settings (per-resource)
// When null, uses global settings from SettingsService
/// <summary>
/// Override for maximum orphan linking iterations.
/// When null, uses the global setting.
/// </summary>
public int? OrphanLinkingMaxIterations { get; set; }
/// <summary>
/// Override for minimum confidence threshold for orphan linking.
/// When null, uses the global setting.
/// </summary>
public float? OrphanLinkingMinConfidence { get; set; }
/// <summary>
/// Gets the effective max iterations (resource override or global default).
/// </summary>
public int GetEffectiveMaxIterations(int globalDefault)
=> OrphanLinkingMaxIterations ?? globalDefault;
/// <summary>
/// Gets the effective min confidence (resource override or global default).
/// </summary>
public float GetEffectiveMinConfidence(float globalDefault)
=> OrphanLinkingMinConfidence ?? globalDefault;
}
public enum ResourceType
{
Text,
Txt,
Docx,
Pdf
}