From f143f2517802029e3bad077623a6d497921a963f Mon Sep 17 00:00:00 2001 From: lucyq Date: Mon, 25 Feb 2019 16:45:34 -0500 Subject: [PATCH 1/6] added new cell errors to usability metrics --- client/app/controllers/tableController.js | 14 ++++++++------ client/app/controllers/usabilityController.js | 4 ++++ client/app/data/pacesetters.js | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/app/controllers/tableController.js b/client/app/controllers/tableController.js index e55f2aac..56e6174e 100644 --- a/client/app/controllers/tableController.js +++ b/client/app/controllers/tableController.js @@ -1,4 +1,4 @@ -define(['jquery', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qtip'], function ($, Handsontable, table_template, filesaver, alertify) { +define(['jquery','controllers/usabilityController', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qtip'], function ($, usabilityController, Handsontable, table_template, filesaver, alertify) { 'use strict'; @@ -567,11 +567,13 @@ define(['jquery', 'Handsontable', 'table_template', 'filesaver', 'alertify', 'qt beforeChange: function (changes, source) { return !(this.readOnly); }, - afterSetDataAtCell: function (changes, source) { - //update_width(this); - }, - afterChange: function (row, column) { - //update_width(this); + afterSetDataAtCell: function (changes) { + var cellInput = changes[0][3]; + if (cellInput === '') { + usabilityController.addValidationError('EMPTY_CELL'); + } else if (isNaN(parseInt(cellInput))) { + usabilityController.addValidationError('INVALID_CELL'); + } } }; diff --git a/client/app/controllers/usabilityController.js b/client/app/controllers/usabilityController.js index bfac60ad..83fe672b 100644 --- a/client/app/controllers/usabilityController.js +++ b/client/app/controllers/usabilityController.js @@ -79,6 +79,10 @@ define(['table_template'], function (table_template) { } function addValidationError(err) { + + if (analytics.validation_errors[err] === undefined) { + return; + } analytics.validation_errors[err] += 1; } diff --git a/client/app/data/pacesetters.js b/client/app/data/pacesetters.js index 3008be2e..f746e157 100644 --- a/client/app/data/pacesetters.js +++ b/client/app/data/pacesetters.js @@ -221,8 +221,8 @@ define([], function () { 'GENERIC_TABLE_ERR', 'SERVER_ERR', 'GENERIC_SUBMISSION_ERR', - 'NAN_EMPTY_CELLS', - 'SEMANTIC_CELLS', + 'EMPTY_CELL', + 'INVALID_CELL', 'CELL_ERROR' ] } From 4f276a37d29c54becc284e7ce2732bba8b97140b Mon Sep 17 00:00:00 2001 From: p-flock Date: Tue, 26 Feb 2019 09:44:07 -0500 Subject: [PATCH 2/6] remove drag and drop for UI study --- client/app/views/clientView.js | 10 +++++----- client/index.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/app/views/clientView.js b/client/app/views/clientView.js index cafaef35..680d80ac 100755 --- a/client/app/views/clientView.js +++ b/client/app/views/clientView.js @@ -142,8 +142,8 @@ define(['jquery', 'controllers/clientController', 'controllers/tableController', } }; - var _target = document.getElementById('drop-area'); - var _choose = document.getElementById('choose-file-button'); + //var _target = document.getElementById('drop-area'); + //var _choose = document.getElementById('choose-file-button'); var spinner; var _workstart = function () { spinner = new Spinner().spin(_target); @@ -202,17 +202,17 @@ define(['jquery', 'controllers/clientController', 'controllers/tableController', calculateSize(); }; - DropSheet({ + /*DropSheet({ drop: _target, choose: _choose, tables: tables, tables_def: table_template, on: {workstart: _workstart, workend: _workend, sheet: _onsheet}, errors: {badfile: _badfile, pending: _pending, failed: _failed, large: _large} - }); + });*/ // Table accordion. - $('#tables-area').hide(); + //$('#tables-area').hide(); $('#expand-table-button').click(function (e) { $('#tables-area').slideToggle(function () { diff --git a/client/index.html b/client/index.html index 8e646add..2f189cb6 100755 --- a/client/index.html +++ b/client/index.html @@ -100,7 +100,7 @@

Input your data

-
+
From 39429f2825d93e3464cc2af9e26b7eda0917f552 Mon Sep 17 00:00:00 2001 From: p-flock Date: Tue, 26 Feb 2019 09:45:47 -0500 Subject: [PATCH 3/6] remove text alluding to drag and drop option --- client/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/index.html b/client/index.html index 2f189cb6..8ff6cd69 100755 --- a/client/index.html +++ b/client/index.html @@ -116,8 +116,8 @@

Input your data

View your data

-

Your data will appear here after you drag/drop or browse to find your completed Excel - template file above.

+
From 59798e8c3d1267cbb09740dbe167aa7ba198e582 Mon Sep 17 00:00:00 2001 From: p-flock Date: Tue, 26 Feb 2019 09:48:19 -0500 Subject: [PATCH 4/6] remove text alluding to drag and drop option from instructions --- client/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/index.html b/client/index.html index 8ff6cd69..da09978f 100755 --- a/client/index.html +++ b/client/index.html @@ -62,9 +62,8 @@

{{ title }}

Input your data

Please make sure your session key and participation code match the ones provided in the email - sent to you by the Greater Boston Chamber of Commerce. Drag and drop your completed template file to encrypt and include your submission in - the - aggregate data.

+ sent to you by the Greater Boston Chamber of Commerce. +


From 715b13d33da247e04711d787e3367bcb062999cd Mon Sep 17 00:00:00 2001 From: p-flock Date: Tue, 26 Feb 2019 11:00:46 -0500 Subject: [PATCH 5/6] stop checking for prefilled data --- client/app/controllers/clientController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app/controllers/clientController.js b/client/app/controllers/clientController.js index c76806e6..747189f9 100755 --- a/client/app/controllers/clientController.js +++ b/client/app/controllers/clientController.js @@ -283,9 +283,9 @@ define(['jquery', 'controllers/tableController', 'controllers/jiffController', ' data_submission[tables_data[i].name] = tables_data[i].data; } - if (document.getElementById('choose-file').files.length > 0) { + /*if (document.getElementById('choose-file').files.length > 0) { usabilityController.dataPrefilled(); - } + }*/ data_submission['usability'] = usabilityController.analytics; From 43a7947f47c85abc5634648e1c317e965dc35cd0 Mon Sep 17 00:00:00 2001 From: Peter Flockhart <412265+p-flock@users.noreply.github.com> Date: Tue, 26 Feb 2019 21:21:01 -0500 Subject: [PATCH 6/6] Revert "No deag ui" --- client/app/controllers/clientController.js | 4 ++-- client/app/views/clientView.js | 10 +++++----- client/index.html | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/client/app/controllers/clientController.js b/client/app/controllers/clientController.js index 747189f9..c76806e6 100755 --- a/client/app/controllers/clientController.js +++ b/client/app/controllers/clientController.js @@ -283,9 +283,9 @@ define(['jquery', 'controllers/tableController', 'controllers/jiffController', ' data_submission[tables_data[i].name] = tables_data[i].data; } - /*if (document.getElementById('choose-file').files.length > 0) { + if (document.getElementById('choose-file').files.length > 0) { usabilityController.dataPrefilled(); - }*/ + } data_submission['usability'] = usabilityController.analytics; diff --git a/client/app/views/clientView.js b/client/app/views/clientView.js index 85377c95..601fa413 100644 --- a/client/app/views/clientView.js +++ b/client/app/views/clientView.js @@ -131,8 +131,8 @@ define(['jquery', 'controllers/clientController', 'controllers/tableController', } }; - //var _target = document.getElementById('drop-area'); - //var _choose = document.getElementById('choose-file-button'); + var _target = document.getElementById('drop-area'); + var _choose = document.getElementById('choose-file-button'); var spinner; var _workstart = function () { spinner = new Spinner().spin(_target); @@ -177,17 +177,17 @@ define(['jquery', 'controllers/clientController', 'controllers/tableController', }(cols)); }; - /*DropSheet({ + DropSheet({ drop: _target, choose: _choose, tables: tables, tables_def: table_template, on: {workstart: _workstart, workend: _workend, sheet: _onsheet}, errors: {badfile: _badfile, pending: _pending, failed: _failed, large: _large} - });*/ + }); // Table accordion. - //$('#tables-area').hide(); + $('#tables-area').hide(); $('#expand-table-button').click(function (e) { $('#tables-area').slideToggle(function () { diff --git a/client/index.html b/client/index.html index 0836a01c..0d82afbb 100755 --- a/client/index.html +++ b/client/index.html @@ -65,8 +65,9 @@

{{ title }}

Input your data

Please make sure your session key and participation code match the ones provided in the email - sent to you by the Greater Boston Chamber of Commerce. -

+ sent to you by the Greater Boston Chamber of Commerce. Drag and drop your completed template file to encrypt and include your submission in + the + aggregate data.


@@ -102,7 +103,7 @@

Input your data

- +
@@ -118,8 +119,8 @@

Input your data

View your data

- +

Your data will appear here after you drag/drop or browse to find your completed Excel + template file above.