Commit d3d9edf3 authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Task #15973: Add possibility to disable vote for all questions.

parent fbbe68da
......@@ -56,6 +56,7 @@ Ext.define("ARSnova.controller.Questions", {
sTP.audienceQuestionPanel.setController(this);
sTP.showcaseQuestionPanel.setController(this);
sTP.showcaseQuestionPanel.setLectureMode();
sTP.audienceQuestionPanel.voteStatusButton.setLecturerQuestionsMode();
sTP.audienceQuestionPanel.questionStatusButton.setLecturerQuestionsMode();
sTP.audienceQuestionPanel.toolbar.getTitle().setTitle(Messages.LECTURE_QUESTIONS);
sTP.audienceQuestionPanel.newQuestionButton.text = Messages.NEW_LECTURE_QUESTION;
......
......@@ -194,10 +194,12 @@
CLOSED_QUESTION: "Gesperrte Frage",
CLOSED_VOTING: "Abstimmung gesperrt",
CONFIRM_CLOSE_VOTE: "Abstimmung wirklich sperren?",
CONFIRM_CLOSE_ALL_VOTES: "Abstimmungen wirklich sperren?",
CONFIRM_CLOSE_QUESTION: "Frage wirklich sperren?",
CONFIRM_CLOSE_ALL_QUESTIONS: "Fragen wirklich sperren?",
CONFIRM_CLOSE_QUESTION_MESSAGE: "Wenn Sie die Frage sperren, können Student/innen die Frage weder sehen noch beantworten.",
CONFIRM_CLOSE_VOTE_MESSAGE: "Wenn Sie die Abstimmung sperren, können Student/innen die Frage nicht mehr beantworten.",
CONFIRM_CLOSE_ALL_VOTES_MESSAGE: "Wenn Sie die Abstimmung für alle Fragen sperren, können Student/innen die Fragen nicht mehr beantworten.",
CONFIRM_CLOSE_ALL_QUESTIONS_MESSAGE: "Wenn Sie die Fragen sperren, können Student/innen die Fragen weder sehen noch beantworten.",
SAVE_AND_CONTINUE: 'Speichern und neue Frage stellen',
PICTURE_MAX_FILESIZE: "Maximale Bilddateigröße: ###",
......@@ -529,6 +531,7 @@
RELEASE_STATISTIC: "Statistik<br/>freigeben",
RELEASE_QUESTION: "Frage<br/>freigeben",
RELEASE_VOTE: "Abstimmung<br/>freigeben",
RELEASE_ALL_VOTES: "Abstimmungen<br/>freigeben",
RELEASE_ALL_QUESTIONS: "Fragen<br/>freigeben",
STOP_QUESTION: "Frage<br/>sperren",
STOP_ALL_QUESTIONS: "Fragen<br/>sperren",
......@@ -757,10 +760,12 @@
CLOSED_QUESTION: "Closed Question",
CLOSED_VOTING: "Vote closed",
CONFIRM_CLOSE_VOTE: "Are you sure to close the vote?",
CONFIRM_CLOSE_ALL_VOTES: "Are you sure to close the votes?",
CONFIRM_CLOSE_QUESTION: "Are you sure to close this question?",
CONFIRM_CLOSE_ALL_QUESTIONS: "Are you sure to close all questions?",
CONFIRM_CLOSE_QUESTION_MESSAGE: "If you close this question, students will not be able to view or answer this question.",
CONFIRM_CLOSE_VOTE_MESSAGE: "If you close the vote, students will not be able to answer this question.",
CONFIRM_CLOSE_ALL_VOTES_MESSAGE: "If you close the vote for all questions, students will not be able to answer any question.",
CONFIRM_CLOSE_ALL_QUESTIONS_MESSAGE: "If you close all questions, students will not be able to view or answer any question.",
CONFIRM_ANSWERS_CHANGED: "This will reset all current answers.",
QUESTION_PREVIEW_BUTTON_TITLE: "Preview",
......@@ -1095,6 +1100,7 @@
RELEASE_QUESTION: "Release<br/>question",
RELEASE_ALL_QUESTIONS: "Release<br/>questions",
RELEASE_VOTE: "Release<br/>vote",
RELEASE_ALL_VOTES: "Release<br/>all votes",
STOP_QUESTION: "Lock<br/>question",
STOP_ALL_QUESTIONS: "Lock<br/>questions",
START_SESSION: "Open<br/>access",
......
......@@ -497,7 +497,39 @@ Ext.define('ARSnova.proxy.RestProxy', {
disableQuestionVoting: function (questionId, disable, callbacks) {
this.arsjax.request({
url: "lecturerquestion/" + questionId + "/disableVoting?disable=" + encodeURIComponent(disable),
url: "lecturerquestion/" + questionId + "/disablevote?disable=" + encodeURIComponent(disable),
method: "POST",
success: callbacks.success,
failure: callbacks.failure
});
},
disableAllQuestionVotings: function (sessionKeyword, disable, isLecture, isPreparation, callbacks) {
this.arsjax.request({
url: "lecturerquestion/disablevote?sessionkey=" + encodeURIComponent(sessionKeyword) +
"&disable=" + encodeURIComponent(disable) +
"&lecturequestionsonly=" + encodeURIComponent(isLecture) +
"&preparationquestionsonly=" + encodeURIComponent(isPreparation),
method: "POST",
success: callbacks.success,
failure: callbacks.failure
});
},
disableQuestionVotingForAllLectureQuestions: function (sessionKeyword, disable, callbacks) {
this.arsjax.request({
url: "lecturerquestion/disablevote?sessionkey=" + encodeURIComponent(sessionKeyword) +
"&disable=" + encodeURIComponent(disable) + "&lecturequestionsonly=true",
method: "POST",
success: callbacks.success,
failure: callbacks.failure
});
},
disableQuestionVotingForAllPreparationQuestions: function (sessionKeyword, disable, callbacks) {
this.arsjax.request({
url: "lecturerquestion/disablevote?sessionkey=" + encodeURIComponent(sessionKeyword) +
"&disable=" + encodeURIComponent(disable) + "&preparationquestionsonly=true",
method: "POST",
success: callbacks.success,
failure: callbacks.failure
......
......@@ -275,7 +275,8 @@ Ext.define('ARSnova.view.user.InClass', {
/* will be called on session login */
registerListeners: function () {
var panel = ARSnova.app.mainTabPanel.tabPanel.userTabPanel.inClassPanel;
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.lockVoting, panel.changeVoteActivation, panel);
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.unlockVote, panel.unlockQuestionVote, panel);
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.unlockVotes, panel.questionAvailable, panel);
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.startDelayedPiRound, panel.delayedPiRound, panel);
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.lecturerQuestionAvailable, panel.questionAvailable, panel);
ARSnova.app.questionModel.on(ARSnova.app.questionModel.events.lecturerQuestionLocked, panel.questionLocked, panel);
......@@ -307,7 +308,8 @@ Ext.define('ARSnova.view.user.InClass', {
/* will be called on session logout */
destroyListeners: function () {
var panel = ARSnova.app.mainTabPanel.tabPanel.userTabPanel.inClassPanel;
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.lockVoting, panel.changeVoteActivation, panel);
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.unlockVote, panel.unlockQuestionVote, panel);
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.unlockVotes, panel.questionAvailable, panel);
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.startDelayedPiRound, panel.delayedPiRound, panel);
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.lecturerQuestionAvailable, panel.questionAvailable, panel);
ARSnova.app.questionModel.un(ARSnova.app.questionModel.events.lecturerQuestionLocked, panel.questionLocked, panel);
......@@ -340,15 +342,13 @@ Ext.define('ARSnova.view.user.InClass', {
}
},
changeVoteActivation: function (object) {
unlockQuestionVote: function (object) {
var question = {
"_id": object._id,
"variant": object.variant
};
if (!object.disable) {
this.questionAvailable([question]);
}
this.questionAvailable([question]);
},
questionAvailable: function (questions) {
......
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