Commit 9776159a authored by Saskia Schreiber's avatar Saskia Schreiber

[BUGFIX] Move textchecker strict options to the right view

parent 5ac23a7a
......@@ -1206,4 +1206,4 @@
}
// make Messages globally accessible
exports.Messages = Messages;
})(window);
})(window);
\ No newline at end of file
......@@ -88,6 +88,7 @@ Ext.define('ARSnova.view.FreetextQuestion', {
this.answerText.setHidden(!this.questionObj.textAnswerEnabled);
this.textChecker = Ext.create('ARSnova.view.speaker.form.TextChecker', {
id: 'textChecker',
handlerScope: this,
style: 'margin-bottom: 30px',
show: true
......
......@@ -148,10 +148,6 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
this.abstentionPart = Ext.create('ARSnova.view.speaker.form.AbstentionForm', {
id: 'abstentionPart'
});
this.textCheckerStricktOptionsFormPart = Ext.create('ARSnova.view.speaker.form.textCheckerStricktOptionsForm', {
id: 'textCheckerStricktOptionsFormPart'
});
this.uploadView = Ext.create('ARSnova.view.speaker.form.ImageUploadPanel', {
handlerScope: this,
......@@ -425,7 +421,6 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
}
me.add([
me.abstentionPart,
me.textCheckerStricktOptionsFormPart,
me.uploadView,
me.grid
]);
......@@ -462,9 +457,6 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
values.text = mainPartValues.text;
values.subject = mainPartValues.subject;
values.abstention = !panel.abstentionPart.isHidden() && panel.abstentionPart.getAbstention();
values.ignoreCaseSensitive= !panel.textCheckerStricktOptionsFormPart.isHidden() && panel.textCheckerStricktOptionsFormPart.getIgnoreCaseSensitive();
values.ignoreWhitespaces= !panel.textCheckerStricktOptionsFormPart.isHidden() && panel.textCheckerStricktOptionsFormPart.getIgnoreWhitespaces();
values.ignorePunctuation= !panel.textCheckerStricktOptionsFormPart.isHidden() && panel.textCheckerStricktOptionsFormPart.getIgnorePunctuation();
values.questionVariant = panel.getVariant();
values.image = this.image;
values.flashcardImage = null;
......@@ -584,9 +576,9 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
releasedFor: values.releasedFor,
noCorrect: values.noCorrect,
abstention: values.abstention,
ignoreCaseSensitive: values.ignoreCaseSensitive,
ignoreWhitespaces: values.ignoreWhitespaces,
ignorePunctuation: values.ignorePunctuation,
ignoreCaseSensitive: values.ignoreCaseSensitive,
ignoreWhitespaces: values.ignoreWhitespaces,
ignorePunctuation: values.ignorePunctuation,
showStatistic: 1,
gridSize: values.gridSize,
offsetX: values.offsetX,
......
......@@ -21,7 +21,8 @@ Ext.define('ARSnova.view.speaker.form.FreeTextQuestion', {
requires: [
'Ext.field.Toggle',
'Ext.form.FieldSet'
'Ext.form.FieldSet',
'ARSnova.view.speaker.form.textCheckerStricktOptionsForm'
],
config: {
scrollable: null,
......@@ -30,6 +31,7 @@ Ext.define('ARSnova.view.speaker.form.FreeTextQuestion', {
imageQuestion: false,
textAnswerEnabled: true,
textCheckerStricktOptionsFormPart: null,
initialize: function () {
this.callParent(arguments);
......@@ -87,13 +89,19 @@ Ext.define('ARSnova.view.speaker.form.FreeTextQuestion', {
items: [this.imgUploadBtn]
});
this.add([answerFieldset, this.textAnswerFieldSet]);
this.textCheckerStricktOptionsFormPart = Ext.create('ARSnova.view.speaker.form.textCheckerStricktOptionsForm', {
id: 'textCheckerStricktOptionsFormPart'
});
this.add([answerFieldset, this.textAnswerFieldSet, this.textCheckerStricktOptionsFormPart]);
},
getQuestionValues: function () {
var result = {};
result.imageQuestion = this.imageQuestion;
result.textAnswerEnabled = this.textAnswerEnabled;
result.ignoreCaseSensitive = this.textCheckerStricktOptionsFormPart.getIgnoreCaseSensitive();
result.ignoreWhitespaces = this.textCheckerStricktOptionsFormPart.getIgnoreWhitespaces();
result.ignorePunctuation = this.textCheckerStricktOptionsFormPart.getIgnorePunctuation();
return result;
}
......
......@@ -47,21 +47,22 @@ Ext.define('ARSnova.view.speaker.form.textCheckerStricktOptionsForm', {
pressed: this.getIgnoreCaseSensitive(),
scope: this,
handler: function () {
this.setIgnoreCaseSensitive(!this.getIgnoreCaseSensitive());
this.setIgnoreCaseSensitive(!this.getIgnoreCaseSensitive());
}
},{
text: Messages.TEXT_CHECKER_IGNORE_WHITESPACE,
pressed: this.getIgnoreWhitespaces(),
scope: this,
handler: function () {
this.setIgnoreWhitespaces(!this.getIgnoreWhitespaces());
this.setIgnoreWhitespaces(!this.getIgnoreWhitespaces());
}
}, {
text: Messages.TEXT_CHECKER_IGNORE_PUNCTUATION,
pressed: this.getIgnorePunctuation(),
scope: this,
handler: function () {
this.setIgnorePunctuation(!this.getIgnorePunctuation());
this.setIgnorePunctuation(!this.getIgnorePunctuation());
}
}]
}]
......
Markdown is supported
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