diff --git a/src/main/webapp/app/controller/QuestionExport.js b/src/main/webapp/app/controller/QuestionExport.js index 97e47b722715a74811911d13cb324af66c3a3505..9f4212459ffd66d19ca913e7156d4d1c855fc771 100644 --- a/src/main/webapp/app/controller/QuestionExport.js +++ b/src/main/webapp/app/controller/QuestionExport.js @@ -177,17 +177,31 @@ Ext.define("ARSnova.controller.QuestionExport", { link.click(); }, - parseAnswerOptionsForClick: function (answerOptions, questionType) { + parseAnswerOptionsForClick: function (question) { var clickAnswerOptions = []; - for (var i = 0; i < answerOptions.length; i++) { + if (question.questionType === "freetext" && question.fixedAnswer) { clickAnswerOptions.push({ hashtag: "ImportFromARSnova", questionIndex: 0, - answerText: answerOptions[i].text, - answerOptionNumber: i, - isCorrect: answerOptions[i].correct, - type: "DefaultAnswerOption" + answerText: question.correctAnswer, + answerOptionNumber: 0, + configCaseSensitive: !question.ignoreCaseSensitive, + configTrimWhitespaces: !question.ignoreWhiteSpaces, + configUsePunctuation: !question.ignorePunctuation, + configUseKeywords: true, + type: "FreeTextAnswerOption" }); + } else { + for (var i = 0; i < question.answerOptions.length; i++) { + clickAnswerOptions.push({ + hashtag: "ImportFromARSnova", + questionIndex: 0, + answerText: question.answerOptions[i].text, + answerOptionNumber: i, + isCorrect: question.answerOptions[i].correct, + type: "DefaultAnswerOption" + }); + } } return clickAnswerOptions; }, @@ -195,20 +209,20 @@ Ext.define("ARSnova.controller.QuestionExport", { exportQuestionToClick: function (question) { var clickQuestion = { hashtag: "ImportFromARSnova", - questionText: question.subject + "\\n" + question.text, - timer: 20, + questionText: "## " + question.subject + " ##" + "\n" + question.text, + timer: 30, startTime: 0, questionIndex: 0, - answerOptionList: this.parseAnswerOptionsForClick(question.possibleAnswers, question.questionType) + answerOptionList: this.parseAnswerOptionsForClick(question) }; switch (question.questionType) { case "yesno": clickQuestion.type = "YesNoSingleChoiceQuestion"; break; - case "school": + /*case "school": case "vote": clickQuestion.type = "SurveyQuestion"; - break; + break;*/ case "mc": clickQuestion.type = "MultipleChoiceQuestion"; break; @@ -216,6 +230,9 @@ Ext.define("ARSnova.controller.QuestionExport", { case "abcd": clickQuestion.type = "SingleChoiceQuestion"; break; + case "freetext": + clickQuestion.type = "FreeTextQuestion"; + break; } var session = { hashtag: "ImportFromARSnova", @@ -224,10 +241,10 @@ Ext.define("ARSnova.controller.QuestionExport", { configuration: { hashtag: "ImportFromARSnova", music: { - hashtag: "Hashtag", + hashtag: "ImportFromARSnova", isEnabled: 0, title: "Song1", - volume: 80 + volume: 100 }, theme: "theme-blackbeauty", nicks: { diff --git a/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js b/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js index b68348ee726b4ff8404ad0e7eded05a70dd25091..92d5f58a148932ae4734fd6d331d3af5874089b0 100755 --- a/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js +++ b/src/main/webapp/app/view/speaker/ShowcaseEditButtons.js @@ -41,7 +41,7 @@ Ext.define('ARSnova.view.speaker.ShowcaseEditButtons', { || (['grid'].indexOf(type) !== -1 && type === 'moderation')) { this.hasCorrectAnswers = false; } - if (['yesno', 'school', 'vote', 'mc', 'sc', 'abcd'].indexOf(type) !== -1) { + if ((['yesno', 'mc', 'sc', 'abcd'].indexOf(type) !== -1) || (type === "freetext" && this.questionObj.fixedAnswer)) { this.isExportableToClick = true; }