Skip to content

Commit

Permalink
hide accepted for duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Apr 8, 2024
1 parent f599d14 commit e871e82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MyApp.ServiceInterface/Data/QuestionFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static List<IVirtualFile> WithoutDuplicateAnswers(List<IVirtualFile> 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;
}

Expand All @@ -71,9 +71,9 @@ public void ApplyScores(List<StatTotals> 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;
});
}
Expand Down

0 comments on commit e871e82

Please sign in to comment.