From 26d09ede31f046ba0c6e57ba699629fc34226bb3 Mon Sep 17 00:00:00 2001
From: tekay <tom.kaesler@mni.thm.de>
Date: Wed, 28 Sep 2016 11:21:44 +0200
Subject: [PATCH] change file name to <sessionShortName>_<subject>.json change
 type to application/json

---
 src/main/webapp/app/controller/QuestionExport.js        | 6 +++---
 src/main/webapp/app/view/speaker/ShowcaseEditButtons.js | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/webapp/app/controller/QuestionExport.js b/src/main/webapp/app/controller/QuestionExport.js
index ecea7db36..f186b156d 100644
--- a/src/main/webapp/app/controller/QuestionExport.js
+++ b/src/main/webapp/app/controller/QuestionExport.js
@@ -147,10 +147,10 @@ Ext.define("ARSnova.controller.QuestionExport", {
 		});
 	},
 
-	saveClickQuestionOnFileSystem: function (questionObj) {
+	saveClickQuestionOnFileSystem: function (questionObj, questionSubject) {
 		var rawJson = JSON.stringify(questionObj);
-		var blob = new Blob([rawJson], {type: "text/plain;charset=utf-8"});
-		this.makeAndClickDownloadLink(blob, "ARSnovaClickQuestion");
+		var blob = new Blob([rawJson], {type: "application/json;charset=utf-8"});
+		this.makeAndClickDownloadLink(blob, localStorage.getItem('shortName') + "_" + questionSubject + ".json");
 	},
 
 	parseJsonToCsv: function (records) {
diff --git a/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js b/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js
index a2616d139..5216da508 100755
--- a/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js
+++ b/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js
@@ -143,7 +143,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseEditButtons', {
 			handler: function () {
 				var questionExportController = ARSnova.app.getController('QuestionExport');
 				var clickQuestionObject = questionExportController.exportQuestionToClick(this.questionObj);
-				questionExportController.saveClickQuestionOnFileSystem(clickQuestionObject);
+				questionExportController.saveClickQuestionOnFileSystem(clickQuestionObject, this.questionObj.subject);
 			}
 		});
 
-- 
GitLab