Educators have known for 30 years that students perform better when given one-on-one tutoring and mastery learning—working on a subject until it is mastered, not just until a test is scheduled. Success also requires motivation, whether from an inner drive or from parents, mentors or peers.

Will the rise of massive open online courses (MOOCs) quash these success factors? Not at all. In fact, digital tools offer our best path to cost-effective, personalized learning.

I know because I have taught both ways. For years Sebastian Thrun and I have given artificial-intelligence courses at Stanford University and other schools; we lectured, assigned homework and gave everyone the same exam at the same time. Each semester just 5 to 10 percent of students regularly engaged in deep discussions in class or office hours; the rest were more passive. We felt there had to be a better way.

So, in the fall of 2011, we tried something new. In addition to our traditional classroom, we created a free online course open to anyone. On our first try, we attracted a city's worth of participants—about 100,000 engaged with the course, and 23,000 finished.

Inspired by Nobel laureate Herbert Simon's comment that “learning results from what the student does and thinks and only from what the student does and thinks,” we created a course centered on the students doing things and getting frequent feedback. Our “lectures” were short (two- to six-minute) videos designed to prime the attendees for doing the next exercise. Some problems required the application of mathematical techniques described in the videos. Others were open-ended questions that gave students a chance to think on their own and then to hash out ideas in online discussion forums.

Our scheme to help make learning happen actively, rather than passively, created many benefits akin to tutoring—and helped to increase motivation. First, as shown in a 2013 study by Karl K. Szpunar, Novall Y. Khan and Daniel L. Schacter in the Proceedings of the National Academy of Sciences USA, frequent interactions keep attention from wandering. Second, as William B. Wood and Kimberly D. Tanner describe in a 2012 Life Sciences Education paper, learning is enhanced when students work to construct their own explanations, rather than passively listening to the teacher's. That is why a properly designed automated intelligent tutoring system can foster learning outcomes as well as human instructors can, as Kurt van Lehn found in a 2011 meta-analysis in Educational Psychologist.

A final key advantage was the rapid improvement of the course itself. We analyzed the junctures where our thousands of students succeeded or failed and found where our course needed fine-tuning. Better still, we could capture this information on an hour-by-hour basis. For our class, human teachers analyzed the data, but an artificial-intelligence system could perform this function and then make recommendations for what a pupil could try next to improve—as online shopping sites today make automated recommendations for what book or movie you might enjoy.

Online learning is a tool, just as the textbook is a tool. The way the teacher and the student use the tool is what really counts.