Commit 5ac23a7a authored by Cedric Takongmo's avatar Cedric Takongmo

ignoreCaseSensitive, ignoreWhitespaces and ignorePunctuation properties added...

 ignoreCaseSensitive, ignoreWhitespaces and ignorePunctuation properties added to question. There was not a better option to simulate the check on the backend except in this way. This property are save in the couchDB. Bugfix in ARSnova.view.speaker.form.TextChecker. the undefined function freetextAnswer() has been replace with setFreetextAnswer() or getFreetextAnswer()
parent 96374f38
......@@ -122,7 +122,9 @@ Ext.define("ARSnova.controller.Questions", {
possibleAnswers: options.possibleAnswers,
noCorrect: options.noCorrect,
abstention: options.abstention,
textCheckerStricktOptions: options.textCheckerStricktOptions,
ignoreCaseSensitive: options.ignoreCaseSensitive,
ignoreWhitespaces: options.ignoreWhitespaces,
ignorePunctuation: options.ignorePunctuation,
gridSize: options.gridSize,
offsetX: options.offsetX,
offsetY: options.offsetY,
......
......@@ -33,7 +33,9 @@ Ext.define('ARSnova.model.Answer', {
'questionId',
'sessionId',
'abstention',
'textCheckerStricktOptions',
'ignoreCaseSensitive',
'ignoreWhitespaces',
'ignorePunctuation',
'timestamp',
'questionVariant',
'questionValue',
......
......@@ -58,7 +58,9 @@ Ext.define('ARSnova.model.Question', {
'offsetY',
'zoomLvl',
'image',
'textCheckerStricktOptions',
'ignoreCaseSensitive',
'ignoreWhitespaces',
'ignorePunctuation',
'fcImage',
'gridOffsetX',
'gridOffsetY',
......
......@@ -425,9 +425,9 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
}
me.add([
me.abstentionPart,
me.textCheckerStricktOptionsFormPart,
me.uploadView,
me.grid,
me.textCheckerStricktOptionsFormPart
me.grid
]);
if (me.gridQuestion) {
me.add(me.gridQuestion);
......@@ -462,8 +462,9 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
values.text = mainPartValues.text;
values.subject = mainPartValues.subject;
values.abstention = !panel.abstentionPart.isHidden() && panel.abstentionPart.getAbstention();
/* todo ... Textchecker ui*/
//values.textCheckerStricktOptions= !panel.textCheckerStricktOptionsFormPart.isHidden() && panel.textCheckerStricktOptionsFormPart.gettextCheckerStricktOptions();
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;
......@@ -583,7 +584,9 @@ Ext.define('ARSnova.view.speaker.NewQuestionPanel', {
releasedFor: values.releasedFor,
noCorrect: values.noCorrect,
abstention: values.abstention,
textCheckerStricktOptions: values.textCheckerStricktOptions,
ignoreCaseSensitive: values.ignoreCaseSensitive,
ignoreWhitespaces: values.ignoreWhitespaces,
ignorePunctuation: values.ignorePunctuation,
showStatistic: 1,
gridSize: values.gridSize,
offsetX: values.offsetX,
......
......@@ -42,7 +42,9 @@ Ext.define('FreetextAnswer', {
'groupDate',
'questionId',
'abstention',
'textCheckerStricktOptions',
'ignoreCaseSensitive',
'ignoreWhitespaces',
'ignorePunctuation',
'answerText',
'piRound',
'sessionId',
......@@ -359,14 +361,18 @@ Ext.define('ARSnova.view.speaker.QuestionDetailsPanel', {
question.set("subject", values.subject);
question.set("text", values.questionText);
question.set("abstention", panel.abstentionPart.getAbstention());
/* todo ... Textchecker ui*/
//question.set("textCheckerStricktOptions", panel.textCheckerStricktOptionsFormPart.gettextCheckerStricktOptions());
question.set("ignoreCaseSensitive", panel.textCheckerStricktOptionsFormPart.getIgnoreCaseSensitive());
question.set("ignoreWhitespaces", panel.textCheckerStricktOptionsFormPart.getIgnoreWhitespaces());
question.set("ignorePunctuation", panel.textCheckerStricktOptionsFormPart.getIgnorePunctuation());
question.raw.subject = values.subject;
question.raw.text = values.questionText;
question.raw.abstention = panel.abstentionPart.getAbstention();
/* todo ... Textchecker ui*/
//question.raw.textCheckerStricktOptions = panel.abstentionPart.gettextCheckerStricktOptions();
question.raw.ignoreCaseSensitive = panel.textCheckerStricktOptionsFormPart.getIgnoreCaseSensitive();
question.raw.ignoreWhitespaces = panel.textCheckerStricktOptionsFormPart.getIgnoreWhitespaces();
question.raw.ignorePunctuation = panel.textCheckerStricktOptionsFormPart.getIgnorePunctuation();
panel.subject.resetOriginalValue();
panel.textarea.resetOriginalValue();
......@@ -770,7 +776,9 @@ Ext.define('ARSnova.view.speaker.QuestionDetailsPanel', {
});
this.textCheckerStricktOptionsFormPart = Ext.create('ARSnova.view.speaker.form.textCheckerStricktOptionsForm', {
textCheckerStricktOptions: this.questionObj.textCheckerStricktOptions,
ignoreCaseSensitive: this.questionObj.ignoreCaseSensitive,
ignoreWhitespaces: this.questionObj.ignoreWhitespaces,
ignorePunctuation: this.questionObj.ignorePunctuation,
hidden: true
});
......
......@@ -41,17 +41,17 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
},
items: [{
text: Messages.TEXT_CHECKER_FREETEXT,
pressed: this.freetextAnswer(),
pressed: this.getFreetextAnswer(),
scope: this,
handler: function () {
this.freetextAnswer(true);
this.setFreetextAnswer(true);
}
}, {
text: Messages.TEXT_CHECKER_ADD_SOLUTION,
pressed: !this.freetextAnswer(),
pressed: !this.getFreetextAnswer(),
scope: this,
handler: function () {
this.freetextAnswer(false);
this.setFreetextAnswer(false);
}
}]
}]
......
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