Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-34586 assignment: convert default format value during restore

  • Loading branch information...
commit cd35f43eac8d3f27e887574f95d86723ad3d22d3 1 parent 9844660
Charles Fulton authored July 26, 2012

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. 10  mod/assignment/backup/moodle1/lib.php
10  mod/assignment/backup/moodle1/lib.php
@@ -78,6 +78,8 @@ public function get_paths() {
78 78
      * data available
79 79
      */
80 80
     public function process_assignment($data) {
  81
+        global $CFG;
  82
+	
81 83
         // get the course module id and context id
82 84
         $instanceid     = $data['id'];
83 85
         $cminfo         = $this->get_cminfo($instanceid);
@@ -95,6 +97,12 @@ public function process_assignment($data) {
95 97
         $this->fileman->itemid   = 0;
96 98
         $data['intro'] = moodle1_converter::migrate_referenced_files($data['intro'], $this->fileman);
97 99
 
  100
+        // convert the introformat if necessary
  101
+        if ($CFG->texteditors !== 'textarea') {
  102
+            $data['intro'] = text_to_html($data['intro'], false, false, true);
  103
+            $data['introformat'] = FORMAT_HTML;
  104
+        }
  105
+
98 106
         // start writing assignment.xml
99 107
         $this->open_xml_writer("activities/assignment_{$this->moduleid}/assignment.xml");
100 108
         $this->xmlwriter->begin_tag('activity', array('id' => $instanceid, 'moduleid' => $this->moduleid,
@@ -243,4 +251,4 @@ public function append_subplugin_data($data) {
243 251
  * This class handles subplugins that do not exist or that are not supported
244 252
  */
245 253
 class moodle1_assignment_unsupported_subplugin_handler extends moodle1_assignment_subplugin_handler {
246  
-}
  254
+}

0 notes on commit cd35f43

Please sign in to comment.
Something went wrong with that request. Please try again.