fix "count_learning_flag" in ApplicationController and "calculate_similarity" in CoursesController