Conventional database-learning assessments generally provide aggregate scores without showing which computational thinking components require further support. This study developed a web-based adaptive assessment system for vocational high school students by integrating K-nearest neighbor classification, adaptive hints, and rule-based treatment. The research applied a development approach using the Smart Learning Environment Establishment Guideline through analysis, design, development, implementation, and evaluation stages. The KNN model was developed using 64 empirical records from students in XI RPL 2 and XI RPL 3. Four weighted computational thinking indicators—decomposition, pattern recognition, abstraction, and algorithmic thinking—were used as classification features. KNN, RandomOverSampler–KNN, and Synthetic Minority Over-sampling Technique (SMOTE)–KNN pipelines were evaluated using group-aware cross-validation. The selected SMOTE–KNN model used distance weighting with k = 9 and achieved 92.19% accuracy, 88.59% balanced accuracy, and 89.75% macro F1-score. The classification result adjusted adaptive hints, while explicit rules controlled indicator priority, difficulty progression, mastery points, and treatment transitions. All 24 black-box scenarios met the expected requirements. The novelty and main contribution of this study lie in integrating indicator-level CT diagnosis, data-driven classification, and transparent rule-based adaptation within a single web-based workflow for vocational database learning.