This study investigated whether providing opportunity-to-learn can improve Indonesian students’ performance in solving context-based mathematics tasks. On the basis of an inventory of Indonesian students’ difficulties with these tasks and an analysis of textbooks and classroom practices, an intervention program for mathematics teachers was developed. This program contained tasks with relevant and essential contexts with missing or superfluous information, but without explicitly given mathematical procedures. The program also comprised guidelines for a consultative teaching approach with metacognitive prompts and questions for discussion to promote reflection in class. A field experiment with a pretest-posttest control-group design was carried out in six junior high schools in Indonesia involving 299 eight-graders. Students in the experimental group made significantly more progress on solving context-based mathematics tasks than students in the control group. Furthermore, an analysis of students’ errors revealed that experimental students made significantly fewer task comprehension errors than control students. These results show that providing opportunity-to-learn, that is offering context-based tasks to students, which require mathematical modeling, and having teachers knowing the characteristics of such tasks and using a consultative teaching approach, can improve students’ ability in solving context-based tasks.