21 lines
2.4 KiB
C#
21 lines
2.4 KiB
C#
using PlotLine.Models.Investigations;
|
|
namespace PlotLine.Services.Investigations;
|
|
|
|
// Author-safe projection; numeric evidence and private diagnostic reasons stay in the admin trace.
|
|
public sealed record InvestigationConclusion(string Kind,string Title,string Message,string[] Areas)
|
|
{
|
|
public static InvestigationConclusion From(Catalogue c, Evaluation e)
|
|
{
|
|
InvestigationConclusion Result(string kind,string title,string message,IEnumerable<HypothesisEvidence>? areas=null)=>new(kind,title,message,(areas??[]).Take(2).Select(h=>c.Hypotheses.Single(x=>x.Id==h.Id).Description).ToArray());
|
|
if(e.Recommendations.Count>0)return Result("supported", "A possible next step", "Your answers support the following next step. This reflects the questionnaire, not an analysis of your manuscript.");
|
|
var supported=e.Hypotheses.Where(h=>h.Supported).ToArray();
|
|
if(supported.Length>0&&!supported.Any(h=>h.Eligible))return Result("unavailable","A relevant tool is currently unavailable","Your answers point towards an area worth exploring, but its tool cannot be offered right now. Your investigation is saved. You can revisit an answer or return later.",supported);
|
|
var conflicts=e.Hypotheses.Where(h=>h.Conflicts.Length>0).ToArray();
|
|
if(conflicts.Length>0)return Result("conflicting","Let's check what you meant","Some answers point in different directions. They may concern different moments, or your understanding may have changed. Revisit the relevant answers before choosing a next step.",conflicts);
|
|
var tentative=e.Hypotheses.Where(h=>h.Support+h.Opposition>0).ToArray();
|
|
if(tentative.Length>1)return Result("ambiguous","More than one explanation may fit","Your answers raise more than one possibility. They do not yet support choosing a tool confidently. You can revisit an answer, or continue if further questions are offered.",tentative);
|
|
if(tentative.Length==1)return Result("tentative","One area may be worth exploring","Your answers give us a possible direction, but leave too much uncertain to recommend a tool confidently. This is a tentative possibility. You can revisit your answers, or continue if further questions are offered.",tentative);
|
|
return Result("insufficient","We haven't found a clear direction yet","Your answers have not identified a particular difficulty that this small test catalogue can help with. That does not mean there is a problem with your story. You can revisit an answer, save this investigation, or return to Explore to try another approach.");
|
|
}
|
|
}
|