Testing is a significant part of the teaching and learning process. An assessment test has to include test items that are tailored to the individual learning needs of the students in order to be more accurate and support learning in a more effective way. In this paper, a fuzzy-based mechanism is presented for automatic personalized assessment in an e-learning system for computer programming. Particularly, the selection of the most appropriate test items for each individual student is based on a variety of criteria: (i) the student’s knowledge level, (ii) the student’s prior knowledge of computer programming, (iii) the type of programming errors that the student is prone to make, and (iv) the difficulty level of the test items. Linguistic values are used to determine these criteria. Additionally, 45 fuzzy rules are used over these criteria, which imitate the way of thinking of human tutors with regard to deciding about the most appropriate test items that have to be included in an adaptive test. The presented mechanism was used under real conditions and evaluated by experts and students of the Department of Informatics of the University of Piraeus, Greece with very encouraging results. Specifically, both the participating students and experts found that the presented mechanism creates non-repetitive balanced tests that meet learners’ knowledge level and needs.