Developers of massive open online courses—or MOOCs—may want to take a page from Facebook to keep more students engaged and enrolled, according to researchers.