diff --git a/MyApp.ServiceInterface/Data/QuestionFiles.cs b/MyApp.ServiceInterface/Data/QuestionFiles.cs index 5a5b22d..33fa5d0 100644 --- a/MyApp.ServiceInterface/Data/QuestionFiles.cs +++ b/MyApp.ServiceInterface/Data/QuestionFiles.cs @@ -46,7 +46,7 @@ public static List WithoutDuplicateAnswers(List file var accepted = files.FirstOrDefault(x => x.Name.Contains(".h.accepted")); var mostVoted = files.FirstOrDefault(x => x.Name.Contains(".h.most-voted")); return accepted?.Length == mostVoted?.Length - ? files.Where(x => !Equals(x, mostVoted)).ToList() + ? files.Where(x => !Equals(x, accepted)).ToList() : files; } @@ -71,9 +71,9 @@ public void ApplyScores(List postStats) Question.Answers.Sort((a, b) => { var aScore = postStats.FirstOrDefault(x => x.Id == a.Id)?.GetScore() - ?? GetModelScore(a.Model); + ?? 0; var bScore = postStats.FirstOrDefault(x => x.Id == b.Id)?.GetScore() - ?? GetModelScore(b.Model); + ?? 0; return bScore - aScore; }); }