Don't show questions for preview surveys

This commit is contained in:
nemunaire 2020-03-08 02:18:32 +01:00
parent 0a79763f69
commit 80776bb7a1
4 changed files with 16 additions and 2 deletions

View file

@ -295,6 +295,14 @@ angular.module("AtsebaytApp")
.controller("QuestionsController", function($scope, SurveyQuest, MyResponse, $http, $location) {
$scope.questions = SurveyQuest.query({ surveyId: $scope.survey.id });
$scope.questions.$promise.then(function (questions) {$scope.showSubmit = true;}, function (response) {
$scope.addToast({
variant: "danger",
title: $scope.survey.title,
msg: "Une erreur s'est produite lors de l'accès aux questions : <strong>" + (response.data ? response.data.errmsg : "impossible de contacter le serveur") + "</strong>",
});
$location.url("surveys/")
})
$scope.myresponses = MyResponse.query({ surveyId: $scope.survey.id });
$scope.myresponses.$promise.then(function (responses) {
$scope.questions.$promise.then(function (questions) {