From f05e1240076f3ebcb8d48ef976ded3800feec6dd Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Tue, 1 Sep 2009 18:20:25 -0500 Subject: [PATCH] Fixed Bug in hotspot when use Empty this training - DT #5174 --- main/exercice/question.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main/exercice/question.class.php b/main/exercice/question.class.php index b0d0fcc8d2..a6f6c7f9e7 100644 --- a/main/exercice/question.class.php +++ b/main/exercice/question.class.php @@ -324,6 +324,20 @@ abstract class Question { global $picturePath, $_course, $_user; + if (!file_exists($picturePath)) { + if (mkdir($picturePath)) { + $perm = api_get_setting('permissions_for_new_directories'); + $perm = octdec(!empty($perm)?$perm:'0770'); + chmod($picturePath,$perm); + // document path + $documentPath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . "/document"; + $path = str_replace($documentPath,'',$picturePath); + $title_path = basename($picturePath); + $doc_id = add_document($_course, $path, 'folder', 0,$title_path); + api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', $_user['user_id']); + } + } + // if the question has got an ID if($this->id) {