Hi guys i'm developing a tests generator app using asp mvc. And i need to select random questions based on some conditions randomly using some test template. Each question has a domain and a difficulty. A test template has the following structure.
Formula
NoOfQuestions
QuestionDomain
NoOfQuestionsPerDomain
QuestionDifficulty
NoOfQuestionsPerDifficulty
NoOfQuestions = NoOfQuestionsPerDomain + NoOfQuestionsPerDificulty.
Code
List<Question> questions = ctx.Questions.Where(q => Domains.Contains(q.Domain) && difficulties.Contains(q.Difficulty)).ToList();
My question is how can i choose a random question set based on the properties above ? thanks!