Skip to content
Snippets Groups Projects
Commit e3a72612 authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Add flashcard feature option to addons panel and feature controller

parent 44371345
Branches
Tags
1 merge request!39Flashcards revisited
This commit is part of merge request !39. Comments created here will be created in the context of that merge request.
...@@ -146,6 +146,7 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -146,6 +146,7 @@ Ext.define("ARSnova.controller.Feature", {
jitt: this.applyJittFeature, jitt: this.applyJittFeature,
lecture: this.applyLectureFeature, lecture: this.applyLectureFeature,
feedback: this.applyFeedbackFeature, feedback: this.applyFeedbackFeature,
flashcardFeature: this.applyFlashcardsFeature,
interposed: this.applyInterposedFeature, interposed: this.applyInterposedFeature,
learningProgress: this.applyLearningProgressFeature, learningProgress: this.applyLearningProgressFeature,
slides: this.applySlidesFeature slides: this.applySlidesFeature
...@@ -175,6 +176,7 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -175,6 +176,7 @@ Ext.define("ARSnova.controller.Feature", {
if (!useCases.custom && !useCases.total) { if (!useCases.custom && !useCases.total) {
features.jitt = false; features.jitt = false;
features.learningProgress = false; features.learningProgress = false;
features.flashcardFeature = false;
features.interposed = false; features.interposed = false;
features.feedback = false; features.feedback = false;
features.lecture = false; features.lecture = false;
...@@ -182,7 +184,7 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -182,7 +184,7 @@ Ext.define("ARSnova.controller.Feature", {
features.slides = false; features.slides = false;
if (useCases.flashcard) { if (useCases.flashcard) {
features.lecture = true; features.flashcardFeature = true;
} }
if (useCases.liveFeedback) { if (useCases.liveFeedback) {
...@@ -260,12 +262,32 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -260,12 +262,32 @@ Ext.define("ARSnova.controller.Feature", {
if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) { if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
inClassPanel = tP.speakerTabPanel.inClassPanel; inClassPanel = tP.speakerTabPanel.inClassPanel;
container = inClassPanel.inClassButtons; container = inClassPanel.inClassButtons;
this.applyButtonChange(container, inClassPanel.liveFeedbackButton, enable, 3); this.applyButtonChange(container, inClassPanel.liveFeedbackButton, enable, 4);
} else { } else {
inClassPanel = tP.userTabPanel.inClassPanel; inClassPanel = tP.userTabPanel.inClassPanel;
container = inClassPanel.actionButtonPanel; container = inClassPanel.actionButtonPanel;
this.applyButtonChange(container, inClassPanel.voteButton, enable, 3); this.applyButtonChange(container, inClassPanel.voteButton, enable, 4);
}
},
/**
* apply changes affecting the "flashcards" feature
*/
applyFlashcardsFeature: function (enable) {
var tP = ARSnova.app.mainTabPanel.tabPanel;
var inClassPanel, container, position;
if (ARSnova.app.userRole === ARSnova.app.USER_ROLE_SPEAKER) {
inClassPanel = tP.speakerTabPanel.inClassPanel;
container = inClassPanel.inClassButtons;
position = 3;
} else {
inClassPanel = tP.userTabPanel.inClassPanel;
container = inClassPanel.inClassButtons;
position = 2;
} }
this.applyButtonChange(container, inClassPanel.flashcardQuestionButton, enable, position);
}, },
/** /**
...@@ -379,17 +401,17 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -379,17 +401,17 @@ Ext.define("ARSnova.controller.Feature", {
inClass.updateActionButtonElements(); inClass.updateActionButtonElements();
if (features.jitt && !features.lecture) { if (features.jitt && !features.lecture) {
inClass.changeActionButtonsMode(features);
tabPanel.showcaseQuestionPanel.setPreparationMode(); tabPanel.showcaseQuestionPanel.setPreparationMode();
tabPanel.newQuestionPanel.setVariant('preparation'); tabPanel.newQuestionPanel.setVariant('preparation');
} else if (features.flashcardFeature) {
tabPanel.showcaseQuestionPanel.setFlashcardMode();
tabPanel.newQuestionPanel.setVariant('flashcard');
} else { } else {
inClass.changeActionButtonsMode(features);
tabPanel.showcaseQuestionPanel.setLectureMode(); tabPanel.showcaseQuestionPanel.setLectureMode();
tabPanel.newQuestionPanel.setVariant('lecture'); tabPanel.newQuestionPanel.setVariant('lecture');
} }
if (features.slides) {
inClass.changeActionButtonsMode(features); inClass.changeActionButtonsMode(features);
}
} else { } else {
// hide questionsPanel tab when session has no question features active // hide questionsPanel tab when session has no question features active
tP.userQuestionsPanel.tab.setHidden(!hasQuestionFeatures); tP.userQuestionsPanel.tab.setHidden(!hasQuestionFeatures);
...@@ -413,8 +435,6 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -413,8 +435,6 @@ Ext.define("ARSnova.controller.Feature", {
if (features.slides) { if (features.slides) {
lectureButtonText = Messages.PRESENTATION; lectureButtonText = Messages.PRESENTATION;
questionsButtonText = Messages.MY_QUESTIONS; questionsButtonText = Messages.MY_QUESTIONS;
} else if (features.flashcard) {
lectureButtonText = Messages.FLASHCARDS;
} else if (features.peerGrading) { } else if (features.peerGrading) {
lectureButtonText = Messages.EVALUATION_QUESTIONS; lectureButtonText = Messages.EVALUATION_QUESTIONS;
} }
...@@ -543,15 +563,11 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -543,15 +563,11 @@ Ext.define("ARSnova.controller.Feature", {
if (features.slides && !features.lecture && !features.jitt) { if (features.slides && !features.lecture && !features.jitt) {
panel.questionOptions.setPressedButtons([indexMap[Messages.SLIDE]]); panel.questionOptions.setPressedButtons([indexMap[Messages.SLIDE]]);
panel.optionsToolbar.setHidden(true); panel.optionsToolbar.setHidden(true);
} else if (features.flashcard) {
panel.questionOptions.setPressedButtons([indexMap[Messages.FLASHCARD]]);
panel.optionsToolbar.setHidden(true);
} else if (features.peerGrading) { } else if (features.peerGrading) {
panel.questionOptions.setPressedButtons([indexMap[Messages.EVALUATION]]); panel.questionOptions.setPressedButtons([indexMap[Messages.EVALUATION]]);
panel.optionsToolbar.setHidden(true); panel.optionsToolbar.setHidden(true);
} else if (features.clicker) { } else if (features.clicker) {
options[indexMap[Messages.FREETEXT]].hide(); options[indexMap[Messages.FREETEXT]].hide();
options[indexMap[Messages.FLASHCARD]].hide();
options[indexMap[Messages.EVALUATION]].hide(); options[indexMap[Messages.EVALUATION]].hide();
options[indexMap[Messages.SCHOOL]].hide(); options[indexMap[Messages.SCHOOL]].hide();
options[indexMap[Messages.GRID]].hide(); options[indexMap[Messages.GRID]].hide();
...@@ -559,6 +575,7 @@ Ext.define("ARSnova.controller.Feature", { ...@@ -559,6 +575,7 @@ Ext.define("ARSnova.controller.Feature", {
} else { } else {
panel.optionsToolbar.setHidden(false); panel.optionsToolbar.setHidden(false);
panel.questionOptions.config.showAllOptions(); panel.questionOptions.config.showAllOptions();
options[indexMap[Messages.FLASHCARD]].hide();
if (features.slides) { if (features.slides) {
panel.questionOptions.setPressedButtons([indexMap[Messages.SLIDE]]); panel.questionOptions.setPressedButtons([indexMap[Messages.SLIDE]]);
} }
......
...@@ -113,6 +113,9 @@ Ext.define('ARSnova.view.diagnosis.AddOnsPanel', { ...@@ -113,6 +113,9 @@ Ext.define('ARSnova.view.diagnosis.AddOnsPanel', {
}, { }, {
name: 'jitt', name: 'jitt',
label: Messages.PREPARATION_QUESTIONS_LONG label: Messages.PREPARATION_QUESTIONS_LONG
}, {
name: 'flashcardFeature',
label: Messages.FLASHCARDS
}, { }, {
name: 'interposed', name: 'interposed',
label: Messages.QUESTIONS_FROM_STUDENTS label: Messages.QUESTIONS_FROM_STUDENTS
...@@ -177,7 +180,7 @@ Ext.define('ARSnova.view.diagnosis.AddOnsPanel', { ...@@ -177,7 +180,7 @@ Ext.define('ARSnova.view.diagnosis.AddOnsPanel', {
validateSelection: function (button) { validateSelection: function (button) {
var selection = this.getFeatureValues(); var selection = this.getFeatureValues();
if (!selection.lecture && !selection.interposed && !selection.jitt && !selection.feedback && !selection.slides) { if (!selection.lecture && !selection.interposed && !selection.jitt && !selection.flashcardFeature && !selection.feedback && !selection.slides) {
Ext.Msg.alert(Messages.NOTIFICATION, Messages.FEATURE_SAVE_ERROR, function () { Ext.Msg.alert(Messages.NOTIFICATION, Messages.FEATURE_SAVE_ERROR, function () {
button.enable(); button.enable();
}); });
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment