fixed form completion bug with rating fields
This commit is contained in:
parent
66d41f5a80
commit
53b3196ad2
7
public/dist/application.js
vendored
7
public/dist/application.js
vendored
@ -1559,6 +1559,8 @@ angular.module('forms').run(['Menus',
|
||||
var valid_count = fields.filter(function(field){
|
||||
if(typeof field === 'object' && field.fieldType !== 'statement' && field.fieldType !== 'rating'){
|
||||
return !!(field.fieldValue);
|
||||
} else if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
}
|
||||
|
||||
}).length;
|
||||
@ -3214,10 +3216,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
||||
|
||||
stats[deviceType].visits++;
|
||||
|
||||
if(!stats[deviceType].average_time) {
|
||||
stats[deviceType].average_time = 0;
|
||||
}
|
||||
|
||||
if (visitor.isSubmitted) {
|
||||
stats[deviceType].total_time = stats[deviceType].total_time + visitor.timeElapsed;
|
||||
stats[deviceType].responses++;
|
||||
@ -3232,7 +3230,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(stats);
|
||||
return stats;
|
||||
})();
|
||||
|
||||
|
||||
6
public/dist/application.min.js
vendored
6
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
20
public/dist/form-application.js
vendored
20
public/dist/form-application.js
vendored
@ -482,8 +482,10 @@ angular.module('view-form')
|
||||
var fields = formObj.form_fields;
|
||||
|
||||
var valid_count = fields.filter(function(field){
|
||||
if(typeof field === 'object' && field.fieldType !== 'statement' && field.fieldType !== 'rating'){
|
||||
if(typeof field === 'object' && field.fieldType !== 'rating' && field.fieldType !== 'statement'){
|
||||
return !!(field.fieldValue);
|
||||
} else if (field.fieldType === 'rating'){
|
||||
return true;
|
||||
}
|
||||
|
||||
}).length;
|
||||
@ -796,19 +798,19 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun
|
||||
$scope.forms = {};
|
||||
TimeCounter.restartClock();
|
||||
|
||||
var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
||||
var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||
if(field.fieldType === 'statement'){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).length;
|
||||
|
||||
var nb_valid = $filter('formValidity')($scope.myform);
|
||||
$scope.translateAdvancementData = {
|
||||
done: nb_valid,
|
||||
total: form_fields_count,
|
||||
answers_not_completed: form_fields_count - nb_valid
|
||||
};
|
||||
var nb_valid = $filter('formValidity')($scope.myform);
|
||||
$scope.translateAdvancementData = {
|
||||
done: nb_valid,
|
||||
total: form_fields_count,
|
||||
answers_not_completed: form_fields_count - nb_valid
|
||||
};
|
||||
|
||||
$scope.reloadForm = function(){
|
||||
//Reset Form
|
||||
|
||||
2
public/dist/form-application.min.js
vendored
2
public/dist/form-application.min.js
vendored
File diff suppressed because one or more lines are too long
@ -17,8 +17,10 @@ angular.module('view-form')
|
||||
var fields = formObj.form_fields;
|
||||
|
||||
var valid_count = fields.filter(function(field){
|
||||
if(typeof field === 'object' && field.fieldType !== 'statement' && field.fieldType !== 'rating'){
|
||||
if(typeof field === 'object' && field.fieldType !== 'rating' && field.fieldType !== 'statement'){
|
||||
return !!(field.fieldValue);
|
||||
} else if (field.fieldType === 'rating'){
|
||||
return true;
|
||||
}
|
||||
|
||||
}).length;
|
||||
|
||||
@ -22,19 +22,19 @@ angular.module('view-form').directive('submitFormDirective', ['$http', 'TimeCoun
|
||||
$scope.forms = {};
|
||||
TimeCounter.restartClock();
|
||||
|
||||
var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||
if(field.fieldType === 'statement' || field.fieldType === 'rating'){
|
||||
var form_fields_count = $scope.myform.visible_form_fields.filter(function(field){
|
||||
if(field.fieldType === 'statement'){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}).length;
|
||||
|
||||
var nb_valid = $filter('formValidity')($scope.myform);
|
||||
$scope.translateAdvancementData = {
|
||||
done: nb_valid,
|
||||
total: form_fields_count,
|
||||
answers_not_completed: form_fields_count - nb_valid
|
||||
};
|
||||
var nb_valid = $filter('formValidity')($scope.myform);
|
||||
$scope.translateAdvancementData = {
|
||||
done: nb_valid,
|
||||
total: form_fields_count,
|
||||
answers_not_completed: form_fields_count - nb_valid
|
||||
};
|
||||
|
||||
$scope.reloadForm = function(){
|
||||
//Reset Form
|
||||
|
||||
@ -28,6 +28,8 @@ angular.module('forms').run(['Menus',
|
||||
var valid_count = fields.filter(function(field){
|
||||
if(typeof field === 'object' && field.fieldType !== 'statement' && field.fieldType !== 'rating'){
|
||||
return !!(field.fieldValue);
|
||||
} else if(field.fieldType === 'rating'){
|
||||
return true;
|
||||
}
|
||||
|
||||
}).length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user