diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp
index b591f7536ebe4734d6fe6ed5ad2db68854d0193e..fabeffbaf0a9a5066378861c1de7a3eaa29d4f80 100644
--- a/src/gui/UBTeacherGuideWidget.cpp
+++ b/src/gui/UBTeacherGuideWidget.cpp
@@ -343,6 +343,8 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
         }
     }
     else if(column == 1 && addSubItemWidgetType == eUBTGAddSubItemWidgetType_None){
+        UBTGMediaWidget* media = dynamic_cast<UBTGMediaWidget*>(mpTreeWidget->itemWidget(widget,0));
+        if(media) media->removeSource();
         int index = mpTreeWidget->currentIndex().row();
         QTreeWidgetItem* toBeDeletedWidgetItem = widget->parent()->takeChild(index);
         delete toBeDeletedWidgetItem;
diff --git a/src/gui/UBTeacherGuideWidgetsTools.cpp b/src/gui/UBTeacherGuideWidgetsTools.cpp
index 230ff8cea2cec6dd60e39687f294acf9068bcc1e..bbda8fd12b84decf93d9318a2aeeb5da0f7e5d10 100644
--- a/src/gui/UBTeacherGuideWidgetsTools.cpp
+++ b/src/gui/UBTeacherGuideWidgetsTools.cpp
@@ -342,6 +342,15 @@ void UBTGMediaWidget::initializeWithDom(QDomElement element)
     mIsInitializationMode = false;
 }
 
+void UBTGMediaWidget::removeSource()
+{
+    QFileInfo fileInfo(mMediaPath);
+    if(fileInfo.isFile())
+        QFile(mMediaPath).remove();
+    else
+        UBFileSystemUtils::deleteDir(mMediaPath);
+}
+
 void UBTGMediaWidget::hideEvent(QHideEvent* event)
 {
     if(mpWebView)
@@ -361,9 +370,11 @@ tUBGEElementNode* UBTGMediaWidget::saveData()
     if(!mpTitle)
         return 0;
     tUBGEElementNode* result = new tUBGEElementNode();
+    QString relativePath = mMediaPath;
+    relativePath = relativePath.replace(UBApplication::boardController->activeDocument()->persistencePath()+"/","");
     result->name = "media";
     result->attributes.insert("title",mpTitle->text());
-    result->attributes.insert("relativePath",mMediaPath.replace(UBApplication::boardController->activeDocument()->persistencePath()+"/",""));
+    result->attributes.insert("relativePath",relativePath);
     result->attributes.insert("mediaType",mMediaType);
     return result;
 }
diff --git a/src/gui/UBTeacherGuideWidgetsTools.h b/src/gui/UBTeacherGuideWidgetsTools.h
index bb89add2e22d6ef8a4eb3abf0ab2b0d63fb3f316..7249c6ddb24f107a373ead4a70fb72f2d2ce6a02 100644
--- a/src/gui/UBTeacherGuideWidgetsTools.h
+++ b/src/gui/UBTeacherGuideWidgetsTools.h
@@ -140,6 +140,7 @@ public:
     ~UBTGMediaWidget();
     tUBGEElementNode* saveData();
     void initializeWithDom(QDomElement element);
+    void removeSource();
 
 protected:
     void dragEnterEvent(QDragEnterEvent* event);