I have an project using Hibernate.
This has a class named Question
.
Each Question
has a difficulty level (1,2,3);
Each Question
also has an attribute is field (a,b,c,d,e,f,g,h,i,k);
附录一有100个问题。 我想随机地问20个问题,条件是:
- 7 questions in level 1
- 7 questions in level 2
- 6 questions in level 3.
- Each field have at least 1 question
谢意