A Web-based Java Programming Learning Assistant System (JPLAS) has been developed in our group to advance Java programming educations. JPLAS provides fill-in-blank problems for Java novice students to study grammar and basic programming skills by filling in the blank elements in a high-quality code. In this paper, we first analyze solution results of students in the Java programming course and the correlation between the number of blanks in a problem and the correct answer rate of the students. Then, we extend the blank element selection algorithm to increase the number of blanks and control the problem difficulty by changing it. This algorithm has been proposed to generate a feasible fill-in-blank problem such that any blank has the grammatically correct and unique answer. To verify the effectiveness, we apply the extended algorithm to 58 Java codes for the fundamental data structure or algorithms, and confirm that the extensions can increase the number of blanks and control the problem difficulty.