diff --git a/mod/lesson/backup/moodle2/backup_lesson_stepslib.php b/mod/lesson/backup/moodle2/backup_lesson_stepslib.php
index 83ab18b..3296ed9 100644
--- a/mod/lesson/backup/moodle2/backup_lesson_stepslib.php
+++ b/mod/lesson/backup/moodle2/backup_lesson_stepslib.php
@@ -200,6 +200,7 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st
         // Annotate the file areas in user by the lesson module.
         $lesson->annotate_files('mod_lesson', 'mediafile', null);
         $page->annotate_files('mod_lesson', 'page_contents', 'id');
+        $answer->annotate_files('mod_lesson', 'page_answers', 'id');
 
         // Prepare and return the structure we have just created for the lesson module.
         return $this->prepare_activity_structure($lesson);
diff --git a/mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php b/mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
old mode 100755
new mode 100644
index 3f44d84..819103f
--- a/mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
+++ b/mod/lesson/backup/moodle2/restore_lesson_activity_task.class.php
@@ -55,6 +55,7 @@ class restore_lesson_activity_task extends restore_activity_task {
         $contents = array();
 
         $contents[] = new restore_decode_content('lesson_pages', array('contents'), 'lesson_page');
+        $contents[] = new restore_decode_content('lesson_answers', array('response'), 'lesson_answer'); // mod_ND : ??
 
         return $contents;
     }
diff --git a/mod/lesson/backup/moodle2/restore_lesson_stepslib.php b/mod/lesson/backup/moodle2/restore_lesson_stepslib.php
index 0f2b39b..2400628 100644
--- a/mod/lesson/backup/moodle2/restore_lesson_stepslib.php
+++ b/mod/lesson/backup/moodle2/restore_lesson_stepslib.php
@@ -193,13 +193,15 @@ class restore_lesson_activity_structure_step extends restore_activity_structure_
                     'lessonid' => $answer->lessonid,
                     'pageid' => $answer->pageid,
                     'answerid' => $answer->id));
-            }
+        }
 
         // Add lesson mediafile, no need to match by itemname (just internally handled context)
         $this->add_related_files('mod_lesson', 'mediafile', null);
         // Add lesson page files, by lesson_page itemname
         $this->add_related_files('mod_lesson', 'page_contents', 'lesson_page');
 
+        $this->add_related_files('mod_lesson', 'page_answers', 'lesson_answer');
+        
         // Remap all the restored prevpageid and nextpageid now that we have all the pages and their mappings
         $rs = $DB->get_recordset('lesson_pages', array('lessonid' => $this->task->get_activityid()),
                                  '', 'id, prevpageid, nextpageid');
diff --git a/mod/lesson/editpage.php b/mod/lesson/editpage.php
index f725cae..2dd6549 100644
--- a/mod/lesson/editpage.php
+++ b/mod/lesson/editpage.php
@@ -64,7 +64,7 @@ $editoroptions = array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'max
 // tie up with the current form name, which in turn means the "submitted"
 // check ends up evaluating as false, thus it's not possible to check whether
 // the Question type selection was cancelled. For this reason, a dummy form
-// is created here solely to check whether the selection was cancelled. 
+// is created here solely to check whether the selection was cancelled.
 if ($qtype) {
     $mformdummy = $manager->get_page_form(0, array('editoroptions'=>$editoroptions, 'jumpto'=>$jumpto, 'lesson'=>$lesson, 'edit'=>$edit, 'maxbytes'=>$PAGE->course->maxbytes));
     if ($mformdummy->is_cancelled()) {
@@ -86,6 +86,17 @@ if ($edit) {
     $data->id = $cm->id;
     $editoroptions['context'] = $context;
     $data = file_prepare_standard_editor($data, 'contents', $editoroptions, $context, 'mod_lesson', 'page_contents',  $editpage->id);
+
+    $answerscount = 0;
+    $answers = $editpage->get_answers();
+    foreach ($answers as $answer) {
+        $response_editor = 'response_editor['.$answerscount.']';
+        $data_response_editor = $data->$response_editor;
+        $draftid_editor = file_get_submitted_draft_itemid($response_editor);
+        $currenttext = file_prepare_draft_area($draftid_editor, $PAGE->cm->context->id, 'mod_lesson', 'page_answers', $answer->id, $editoroptions, $data_response_editor['text']);
+        $data->$response_editor = array('text'=>$currenttext, 'format'=>$data_response_editor['format'], 'itemid'=>$draftid_editor);
+        $answerscount++;
+    }
     $mform->set_data($data);
     $PAGE->navbar->add(get_string('edit'), new moodle_url('/mod/lesson/edit.php', array('id'=>$id)));
     $PAGE->navbar->add(get_string('editingquestionpage', 'lesson', get_string($mform->qtypestring, 'lesson')));
diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php
index 4781fbc..8ba0480 100644
--- a/mod/lesson/lib.php
+++ b/mod/lesson/lib.php
@@ -922,6 +922,13 @@ function lesson_pluginfile($course, $cm, $context, $filearea, $args, $forcedownl
         }
         $fullpath = "/$context->id/mod_lesson/$filearea/$pageid/".implode('/', $args);
 
+    } else if ($filearea === 'page_answers') {
+        $pageid = (int)array_shift($args);
+        if (!$page_answers = $DB->get_record('lesson_answers', array('id'=>$pageid))) {
+            return false;
+        }
+        $fullpath = "/$context->id/mod_lesson/$filearea/$pageid/".implode('/', $args);
+
     } else if ($filearea === 'mediafile') {
         array_shift($args); // ignore itemid - caching only
         $fullpath = "/$context->id/mod_lesson/$filearea/0/".implode('/', $args);
@@ -946,6 +953,7 @@ function lesson_pluginfile($course, $cm, $context, $filearea, $args, $forcedownl
 function lesson_get_file_areas() {
     $areas = array();
     $areas['page_contents'] = 'Page contents'; //TODO: localize!!!!
+    $areas['page_answers'] = 'Page answers'; //TODO: localize!!!!
     $areas['mediafile'] = 'Media file'; //TODO: localize!!!!
 
     return $areas;
diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php
index 0925fa0..4f76da7 100644
--- a/mod/lesson/locallib.php
+++ b/mod/lesson/locallib.php
@@ -815,8 +815,8 @@ abstract class lesson_add_page_form_base extends moodleform {
         if ($label === NULL) {
             $label = get_string('response', 'lesson');
         }
-        $this->_form->addElement('editor', 'response_editor['.$count.']', $label, array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
-        $this->_form->setDefault('response_editor['.$count.']', array('text'=>'', 'format'=>FORMAT_MOODLE));
+        $this->_form->addElement('editor', 'response_editor['.$count.']', $label, array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$this->_customdata['maxbytes']));
+        $this->_form->setType('response_editor['.$count.']', PARAM_RAW);
         if ($required) {
             $this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client');
         }
@@ -1882,7 +1882,7 @@ abstract class lesson_page extends lesson_base {
      * @return array
      */
     final public function get_answers() {
-        global $DB;
+        global $DB, $PAGE;
         if ($this->answers === null) {
             $this->answers = array();
             $answers = $DB->get_records('lesson_answers', array('pageid'=>$this->properties->id, 'lessonid'=>$this->lesson->id), 'id');
@@ -1926,7 +1926,7 @@ abstract class lesson_page extends lesson_base {
      * @return stdClass Returns the result of the attempt
      */
     final public function record_attempt($context) {
-        global $DB, $USER, $OUTPUT;
+        global $DB, $USER, $OUTPUT, $PAGE;
 
         /**
          * This should be overridden by each page type to actually check the response
@@ -2029,6 +2029,8 @@ abstract class lesson_page extends lesson_base {
                     $options->overflowdiv = true;
                     $result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter');
                     $result->feedback .= '<div class="correctanswer generalbox"><em>'.get_string("youranswer", "lesson").'</em> : '.$result->studentanswer; // already in clean html
+                    $context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->id);
+                    $result->response = file_rewrite_pluginfile_urls($result->response, 'pluginfile.php', $context->id, 'mod_lesson', 'page_answers', $result->answerid); // must do this BEFORE format_text()!!!!!!
                     $result->feedback .= $OUTPUT->box($result->response, $class); // already conerted to HTML
                     $result->feedback .= '</div>';
                 }
@@ -2160,7 +2162,11 @@ abstract class lesson_page extends lesson_base {
                 if (!isset($this->answers[$i]->id)) {
                     $this->answers[$i]->id =  $DB->insert_record("lesson_answers", $this->answers[$i]);
                 } else {
-                    $DB->update_record("lesson_answers", $this->answers[$i]->properties());
+                    $draftitemid = $_REQUEST['response_editor'][$i]['itemid'];
+                    $response = file_save_draft_area_files($draftitemid, $context->id, 'mod_lesson', 'page_answers', $this->answers[$i]->id, array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$maxbytes), $this->answers[$i]->properties()->response, null);
+                    $withencodedresponse = $this->answers[$i]->properties();
+                    $withencodedresponse->response = $response;
+                    $DB->update_record("lesson_answers", $withencodedresponse);
                 }
 
             } else if (isset($this->answers[$i]->id)) {
diff --git a/mod/lesson/pagetypes/multichoice.php b/mod/lesson/pagetypes/multichoice.php
index 7ab9d2c..0741b41 100644
--- a/mod/lesson/pagetypes/multichoice.php
+++ b/mod/lesson/pagetypes/multichoice.php
@@ -272,6 +272,9 @@ class lesson_page_type_multichoice extends lesson_page {
                 }
             }
             $result->newpageid = $answer->jumpto;
+            $context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->id);
+            $answer->response = file_rewrite_pluginfile_urls($answer->response, 'pluginfile.php', $context->id, 'mod_lesson', 'page_answers', $answer->id); // must do this BEFORE format_text()!!!!!!
+
             $result->response  = format_text($answer->response, $answer->responseformat, $formattextdefoptions);
             $result->userresponse = format_text($answer->answer, $answer->answerformat, $formattextdefoptions);
             $result->studentanswer = $result->userresponse;
@@ -287,6 +290,7 @@ class lesson_page_type_multichoice extends lesson_page {
     }
 
     public function display_answers(html_table $table) {
+        global $PAGE;
         $answers = $this->get_used_answers();
         $options = new stdClass;
         $options->noclean = true;
@@ -310,6 +314,10 @@ class lesson_page_type_multichoice extends lesson_page {
 
             $cells = array();
             $cells[] = "<span class=\"label\">".get_string("response", "lesson")." $i</span>";
+
+            $context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->id);
+            $answer->response = file_rewrite_pluginfile_urls($answer->response, 'pluginfile.php', $context->id, 'mod_lesson', 'page_answers', $answer->id); // must do this BEFORE format_text()!!!!!!
+
             $cells[] = format_text($answer->response, $answer->responseformat, $options);
             $table->data[] = new html_table_row($cells);
 
