Ejemplo n.º 1
0
 public void TestUsersElection()
 {
     var userQuality = new UserQuality(Program.DefaultQuestionList);
     const int n = 1000;
     var quality = userQuality.GetUserInfos().Keys.Select(k => Tuple.Create(k, userQuality.GetUserQuality(k))).OrderByDescending(it => it.Item2).Take(n);
     Console.WriteLine(String.Join("\n", quality.Select(q => q.Item1 + "\t" + q.Item2)));
 }
Ejemplo n.º 2
0
 public AnswerQuality(QuestionList questionList)
 {
     this.questionList = questionList;
     userQuality = new UserQuality(questionList);
     foreach (var answer in questionList.GetAllAnswers().Where(answer => !answers.ContainsKey(answer.Id)))
     {
         answers.Add(answer.Id, answer);
     }
 }
Ejemplo n.º 3
0
 private static void SaveSortedUserQuality(UserQuality userQuality, Func<string, float> func)
 {
     var quality = userQuality.GetUserInfos().Keys.OrderByDescending(func).ToDictionary(user => user, func);
     File.WriteAllText("Users_" + func.Method.Name, String.Join("\n", quality.Select(entry => entry.Key + "\t" + entry.Value)));
 }
Ejemplo n.º 4
0
 public void TestDifferentFuncs()
 {
     var userQuality = new UserQuality(Program.DefaultQuestionList);
     SaveSortedUserQuality(userQuality, userQuality.GetUserQuality);
 }