Index: temp_moodle_dev/moodle/mod/chat/lib.php =================================================================== diff -u -r1546ee090276401ab08e99c1b55910bbc85f3444 -re5c2680d009c7515dc207bd000fe67ec4fc3348d --- temp_moodle_dev/moodle/mod/chat/lib.php (.../lib.php) (revision 1546ee090276401ab08e99c1b55910bbc85f3444) +++ temp_moodle_dev/moodle/mod/chat/lib.php (.../lib.php) (revision e5c2680d009c7515dc207bd000fe67ec4fc3348d) @@ -908,13 +908,12 @@ */ function chat_import_instance($filepath, $userid, $courseid, $sectionid) { // file contents contains serialized chat object - $filestr = file_get_contents($filepath); - $all=unserialize($filestr); - + $filestr = file_get_contents($filepath); + $all=unserialize($filestr); + //we split the array so we can get the chat and its submissions - $chat = $all[0]; - // $messages = $all[1]; - // $users = $all[2]; + $chat = $all; + // import this chat into a new course $chat->course = $courseid;