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