Hi all I have a table where I am storing the number of questions to be displayed and time to be spent on that.
SectionId QuizId SubjectId QuestionCnt Totaltime
1 1 1 5 30
But when I am selecting question I am following an approach to select questions randomly that falls under time to answer between 1 and 30
Select QuestionDesc, Maxtime from Question where Maxtime between 1 and 30 ORDER BY NEWID()
Which is giving me random questions and I am sorting the question that was answered in to a separate table and calculating the left over time before loading another question.
Let us say 1 question loaded which if of 5 minutes then he has 25 minutes left for remaining questions. But the problem here is some times I am getting 5 questions and some time I am getting 3 questions which falls under the time limit like (3*10). But I need to get 5 questions to be answered is it possible?