added field responses
This commit is contained in:
parent
f3ba411afe
commit
7f0c3d9c7b
|
@ -300,12 +300,13 @@ FormSchema.virtual('analytics.fields').get(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
var totalViews = dropoffViews+continueViews;
|
var totalViews = dropoffViews+continueViews;
|
||||||
|
var responses = continueViews;
|
||||||
var continueRate = continueViews/totalViews*100;
|
var continueRate = continueViews/totalViews*100;
|
||||||
var dropoffRate = dropoffViews/totalViews*100;
|
var dropoffRate = dropoffViews/totalViews*100;
|
||||||
|
|
||||||
fieldDropoffs[i] = {
|
fieldDropoffs[i] = {
|
||||||
dropoffViews: dropoffViews,
|
dropoffViews: dropoffViews,
|
||||||
continueViews: continueViews,
|
responses: continueViews,
|
||||||
totalViews: totalViews,
|
totalViews: totalViews,
|
||||||
continueRate: continueRate,
|
continueRate: continueRate,
|
||||||
dropoffRate: dropoffRate,
|
dropoffRate: dropoffRate,
|
||||||
|
|
|
@ -74,7 +74,8 @@ angular.module('forms').config(['$translateProvider', function ($translateProvid
|
||||||
|
|
||||||
FIELD_TITLE: 'Field Title',
|
FIELD_TITLE: 'Field Title',
|
||||||
FIELD_VIEWS: 'Field Views',
|
FIELD_VIEWS: 'Field Views',
|
||||||
FIELD_DROPOFF: 'Field Completion Rate',
|
FIELD_DROPOFF: 'Field Completion',
|
||||||
|
FIELD_RESPONSES: 'Field Responses',
|
||||||
DELETE_SELECTED: 'Delete Selected',
|
DELETE_SELECTED: 'Delete Selected',
|
||||||
EXPORT_TO_EXCEL: 'Export to Excel',
|
EXPORT_TO_EXCEL: 'Export to Excel',
|
||||||
EXPORT_TO_CSV: 'Export to CSV',
|
EXPORT_TO_CSV: 'Export to CSV',
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-title {
|
.field-title-row {
|
||||||
padding-top: 2em;
|
padding-top: 2em;
|
||||||
padding-bottom:1em;
|
padding-bottom:1em;
|
||||||
border-top: #fafafa solid 1px;
|
border-top: #fafafa solid 1px;
|
||||||
|
@ -35,12 +35,12 @@
|
||||||
color: #bab8b8;
|
color: #bab8b8;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
.field-row {
|
.field-detailed-row {
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
padding-bottom:0.3em;
|
padding-bottom:0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row.table-tools {
|
.table-tools {
|
||||||
border-top: #fafafa solid 1px;
|
border-top: #fafafa solid 1px;
|
||||||
padding-top: 2.5em;
|
padding-top: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,12 +56,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
||||||
})();
|
})();
|
||||||
|
|
||||||
$scope.DeviceStatistics = (function(){
|
$scope.DeviceStatistics = (function(){
|
||||||
var stats = {
|
|
||||||
desktop: null,
|
|
||||||
tablet: null,
|
|
||||||
phone: null,
|
|
||||||
other: null
|
|
||||||
};
|
|
||||||
var newStatItem = function(){
|
var newStatItem = function(){
|
||||||
return {
|
return {
|
||||||
visits: 0,
|
visits: 0,
|
||||||
|
@ -72,6 +66,13 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var stats = {
|
||||||
|
desktop: newStatItem(),
|
||||||
|
tablet: newStatItem(),
|
||||||
|
phone: newStatItem(),
|
||||||
|
other: newStatItem()
|
||||||
|
};
|
||||||
|
|
||||||
var visitors = $scope.myform.analytics.visitors;
|
var visitors = $scope.myform.analytics.visitors;
|
||||||
|
|
||||||
console.log(visitors);
|
console.log(visitors);
|
||||||
|
@ -79,9 +80,6 @@ angular.module('forms').directive('editSubmissionsFormDirective', ['$rootScope',
|
||||||
var visitor = visitors[i];
|
var visitor = visitors[i];
|
||||||
var deviceType = visitor.deviceType;
|
var deviceType = visitor.deviceType;
|
||||||
|
|
||||||
if(!stats[deviceType]){
|
|
||||||
stats[deviceType] = newStatItem();
|
|
||||||
}
|
|
||||||
stats[deviceType].visits++;
|
stats[deviceType].visits++;
|
||||||
|
|
||||||
stats[deviceType].total_time =+ visitor.timeElapsed;
|
stats[deviceType].total_time =+ visitor.timeElapsed;
|
||||||
|
|
|
@ -206,29 +206,34 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row col-xs-12 field-title">
|
<div class="row col-xs-12 field-title-row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-3">
|
||||||
<strong>{{ 'FIELD_TITLE' | translate }}</strong>
|
<strong>{{ 'FIELD_TITLE' | translate }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-3">
|
||||||
<strong>{{ 'FIELD_VIEWS' | translate }}</strong>
|
<strong>{{ 'FIELD_VIEWS' | translate }}</strong>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-3">
|
||||||
|
<strong>{{ 'FIELD_RESPONSES' | translate }}</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-3">
|
||||||
<strong>{{ 'FIELD_DROPOFF' | translate }}</strong>
|
<strong>{{ 'FIELD_DROPOFF' | translate }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row col-xs-12 field-row" ng-repeat="fieldStats in myform.analytics.fields">
|
<div class="row col-xs-12 field-detailed-row" ng-repeat="fieldStats in myform.analytics.fields">
|
||||||
|
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-3">
|
||||||
{{fieldStats.field.title}}
|
{{fieldStats.field.title}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-3">
|
||||||
{{fieldStats.totalViews}}
|
{{fieldStats.totalViews}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-3">
|
||||||
<div class="col-xs-4">
|
{{fieldStats.responses}}
|
||||||
{{fieldStats.dropoffRate}}%
|
</div>
|
||||||
|
<div class="col-xs-3">
|
||||||
|
{{fieldStats.continueRate}}%
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue