Skip to content

Commit

Permalink
fix max total
Browse files Browse the repository at this point in the history
  • Loading branch information
PHAN Xuan Quang committed Sep 12, 2024
1 parent 9061a00 commit 6918940
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Events/QuizScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ public static async Task<List<Quiz>> GenerateQuizes(string apiKey, string topic,
{
throw new InvalidOperationException("Error while executing");
}
return results;

return results
.Take(questionsCount)
.Select(q => new Quiz
{
Question = q.Question.Replace("**", "'"),
Options = q.Options.Select(o => o.Replace("**", "'")).ToList(),
RightOptionIndex = q.RightOptionIndex,
ExplanationInVietnamese = q.ExplanationInVietnamese.Replace("**", "'"),
})
.ToList();
}
else
{
Expand Down

0 comments on commit 6918940

Please sign in to comment.