Nowadays Java has been educated in many universities and professional schools as a reliable, portable, and practical programming language. To assist self-studies by students, we have developed a Web-based Java Programming Learning Assistant System (JPLAS). JPLAS has the two main functions of code writing problem and fill-in-the-blank problem to support studies at different levels. The former function intends that a student can write a whole code from scratch, where the submitted code is automatically tested on the server using the test-driven development (TDD) method. The latter function intends that a novice student can study Java reserved words, where a problem is generated by randomly removing the specified ones from a selected sample code and the removed one becomes the correct answer to each blank. In this paper, we extend this latter function for removing more general elements including variables and control symbols in problems. We analyze the conditions for selecting blanked elements with unique correct answers. For evaluations, we generated 100 problems with various levels using the extended function, and assigned them to students in the Java programming course in our department. Then, we gave a short test and a questionnaire with nine questions, where we found that students solving more problems achieved better scores in general, and their opinions support the effectiveness of our proposal.