From 14950ac0d166e6ac2a3ce555ce939eb1a45d6146 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Wed, 26 Jun 2019 09:19:53 -0400 Subject: [PATCH 01/35] added function to submit participation score --- src/js/materia/materia.score.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index 2cfd46f6..9e9e5f63 100644 --- a/src/js/materia/materia.score.js +++ b/src/js/materia/materia.score.js @@ -3,6 +3,7 @@ Namespace('Materia').Score = (() => { const WIDGET_INTERACTION_UNSCORED = 1001 // any (scorable) widget intraction beyond a basic answered question. Includes question adjustments, overall adjustments, etc const FINAL_SCORE_FROM_CLIENT = 1002 // a final score from the widget const QUESTION_ANSWERED_UNSCORED = 1004 // a basic answered question (e.g., 'what color is the sky?' 'blue') + const UNSCORABLE = 1006; // an unscorable widget const SCORE_FEEDBACK = 1008 // attaches a feedback message to a question (or game if qid is 0) const DATA = 2000 @@ -35,6 +36,12 @@ Namespace('Materia').Score = (() => { const submitQuestionForScoring = (questionID, userAnswer, value) => Materia.Engine.addLog(QUESTION_ANSWERED_UNSCORED, questionID, userAnswer, value) + // A participation score submission + // This logs a participation grade for unscorable widgets. + // @param questionID the ID of the question being answered + const submitUnscorableForParticipation = (questionID) => + Materia.Engine.addLog(UNSCORABLE, questionID, 'Participation', 100) + // Adds a message/feedback to the overall score screen const addGlobalScoreFeedback = msg => Materia.Engine.addLog(SCORE_FEEDBACK, '0', msg) @@ -44,6 +51,7 @@ Namespace('Materia').Score = (() => { submitInteractionForScoring, submitFinalScoreFromClient, submitQuestionForScoring, + submitUnscorableForParticipation, addGlobalScoreFeedback, addScoreData } From b86ab79384f8516fa9df31912ff228b9add9a6ef Mon Sep 17 00:00:00 2001 From: Weining Li Date: Wed, 26 Jun 2019 09:48:48 -0400 Subject: [PATCH 02/35] added test for submit participation function --- src/js/materia/materia.score.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/materia/materia.score.test.js b/src/js/materia/materia.score.test.js index b8738a84..6d60de88 100644 --- a/src/js/materia/materia.score.test.js +++ b/src/js/materia/materia.score.test.js @@ -13,6 +13,7 @@ describe('Materia.Score', () => { expect(Score.submitInteractionForScoring).toBeDefined() expect(Score.submitFinalScoreFromClient).toBeDefined() expect(Score.submitQuestionForScoring).toBeDefined() + expect(Score.submitUnscorableForParticipation).toBeDefined() expect(Score.addGlobalScoreFeedback).toBeDefined() expect(Score.addScoreData).toBeDefined() }) @@ -27,6 +28,11 @@ describe('Materia.Score', () => { expect(mockAddLog).toHaveBeenLastCalledWith(1008, '0', 'my message') }) + it('submitUnscorableForParticipation calls addLog', () => { + Score.submitUnscorableForParticipation(01000101) + expect(mockAddLog).toHaveBeenLastCalledWith(1006, 01000101, 'Participation', 100) + }) + it('submitQuestionForScoring calls addLog', () => { Score.submitQuestionForScoring(6, 'answer', 'optional value') expect(mockAddLog).toHaveBeenLastCalledWith(1004, 6, 'answer', 'optional value') From 7b2af4b5edb3107ed3187f2b83ac2f7c9abcfac5 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Wed, 26 Jun 2019 15:51:47 -0400 Subject: [PATCH 03/35] =?UTF-8?q?made=20code=20prettier=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/materia/materia.score.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index 9e9e5f63..9442574a 100644 --- a/src/js/materia/materia.score.js +++ b/src/js/materia/materia.score.js @@ -3,7 +3,7 @@ Namespace('Materia').Score = (() => { const WIDGET_INTERACTION_UNSCORED = 1001 // any (scorable) widget intraction beyond a basic answered question. Includes question adjustments, overall adjustments, etc const FINAL_SCORE_FROM_CLIENT = 1002 // a final score from the widget const QUESTION_ANSWERED_UNSCORED = 1004 // a basic answered question (e.g., 'what color is the sky?' 'blue') - const UNSCORABLE = 1006; // an unscorable widget + const UNSCORABLE = 1006 // an unscorable widget const SCORE_FEEDBACK = 1008 // attaches a feedback message to a question (or game if qid is 0) const DATA = 2000 @@ -39,7 +39,7 @@ Namespace('Materia').Score = (() => { // A participation score submission // This logs a participation grade for unscorable widgets. // @param questionID the ID of the question being answered - const submitUnscorableForParticipation = (questionID) => + const submitUnscorableForParticipation = questionID => Materia.Engine.addLog(UNSCORABLE, questionID, 'Participation', 100) // Adds a message/feedback to the overall score screen From aa4fde9473d0a2f3e44c9b0ea197716c5c443f2e Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Fri, 28 Jun 2019 10:02:27 -0400 Subject: [PATCH 04/35] Add new styling to move logged in user info to the right --- src/css/core.scss | 52 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 5e31dec2..176766cc 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -60,13 +60,38 @@ header { background: #fff url(../../../img/header_border_alt.png) 0% 100% repeat-x; } + ul, + p { + margin: 0; + padding: 0; + } + .avatar { font-family: 'Lucida Grande', arial, serif; + right: 20px; + line-height: 0; img { - width: 24px; - height: 24px; + width: 28px; + height: 28px; + } + + br { display: block; + content: ''; + margin-top: -10px; + } + + span { + position: absolute; + right: 32px; + } + + a { + span { + display: inline; + position: static; + } } } .user { @@ -76,13 +101,7 @@ header { top: 36px; } .user.avatar { - top: 12px; - } - - ul, - p { - margin: 0; - padding: 0; + top: 28px; } } @@ -177,9 +196,20 @@ nav { } .user.avatar { - position: static; - display: inline-block; + right: 62px; + top: 35px; max-width: calc(100% - 185px); + + span { + display: none; + } + + img { + float: none; + margin: right; + height: 35px; + width: 35px; + } } } From 6fe8afa492a34799c02c1d4e602c3d15fbb00257 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 28 Jun 2019 10:44:24 -0400 Subject: [PATCH 05/35] question ID not required for participation --- src/js/materia/materia.score.js | 4 ++-- src/js/materia/materia.score.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index 9442574a..dbe84557 100644 --- a/src/js/materia/materia.score.js +++ b/src/js/materia/materia.score.js @@ -39,8 +39,8 @@ Namespace('Materia').Score = (() => { // A participation score submission // This logs a participation grade for unscorable widgets. // @param questionID the ID of the question being answered - const submitUnscorableForParticipation = questionID => - Materia.Engine.addLog(UNSCORABLE, questionID, 'Participation', 100) + const submitUnscorableForParticipation = () => + Materia.Engine.addLog(UNSCORABLE, -1, 'Participation', 100) // Adds a message/feedback to the overall score screen const addGlobalScoreFeedback = msg => Materia.Engine.addLog(SCORE_FEEDBACK, '0', msg) diff --git a/src/js/materia/materia.score.test.js b/src/js/materia/materia.score.test.js index 6d60de88..abbf2402 100644 --- a/src/js/materia/materia.score.test.js +++ b/src/js/materia/materia.score.test.js @@ -29,8 +29,8 @@ describe('Materia.Score', () => { }) it('submitUnscorableForParticipation calls addLog', () => { - Score.submitUnscorableForParticipation(01000101) - expect(mockAddLog).toHaveBeenLastCalledWith(1006, 01000101, 'Participation', 100) + Score.submitUnscorableForParticipation() + expect(mockAddLog).toHaveBeenLastCalledWith(1006, -1, 'Participation', 100) }) it('submitQuestionForScoring calls addLog', () => { From 1874bfbff0f6e37c69b5ff4d66c185a4300de105 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 28 Jun 2019 15:28:50 -0400 Subject: [PATCH 06/35] added academic benefits of widgets --- __test__/mockapi/widget_instances_get.json | 45 +++++++++++++++++++ __test__/mockapi/widgets_get.json | 5 +++ src/css/widget-detail.scss | 3 +- .../ctrl-widget-catalog.test.js.snap | 3 ++ src/js/controllers/ctrl-widget-catalog.js | 10 ++++- .../controllers/ctrl-widget-catalog.test.js | 10 +++-- src/js/controllers/ctrl-widget-details.js | 2 + .../controllers/ctrl-widget-details.test.js | 1 + 8 files changed, 74 insertions(+), 5 deletions(-) diff --git a/__test__/mockapi/widget_instances_get.json b/__test__/mockapi/widget_instances_get.json index fc4753f4..c8d61b37 100644 --- a/__test__/mockapi/widget_instances_get.json +++ b/__test__/mockapi/widget_instances_get.json @@ -424,6 +424,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1053,6 +1058,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1368,6 +1378,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1684,6 +1699,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1747,6 +1767,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1810,6 +1835,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1873,6 +1903,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -2067,6 +2102,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -2788,6 +2828,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" diff --git a/__test__/mockapi/widgets_get.json b/__test__/mockapi/widgets_get.json index d61d22ed..644e8d1b 100644 --- a/__test__/mockapi/widgets_get.json +++ b/__test__/mockapi/widgets_get.json @@ -27,6 +27,11 @@ "supported_data": [ "Question/Answer" ], + "benefits": [ + "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", + "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", + "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" + ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "9zBg0" diff --git a/src/css/widget-detail.scss b/src/css/widget-detail.scss index 11993467..53d48d87 100644 --- a/src/css/widget-detail.scss +++ b/src/css/widget-detail.scss @@ -57,7 +57,8 @@ $color-features-active: #0357a5; font-size: 12px; } - .guide-link { + .guide-link, + .benefit-link { font-size: 13px; padding: 2px 25px 2px 6px; border-radius: 2px; diff --git a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap index 6d61f89d..dc86471d 100644 --- a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap +++ b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap @@ -181,6 +181,9 @@ Array [ "supported_three", "SuPpOrTeD FoUr!!", ], + "benefits": Array [ + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ] }, "name": "widget1", }, diff --git a/src/js/controllers/ctrl-widget-catalog.js b/src/js/controllers/ctrl-widget-catalog.js index 5e87b1ed..49916bd7 100644 --- a/src/js/controllers/ctrl-widget-catalog.js +++ b/src/js/controllers/ctrl-widget-catalog.js @@ -84,6 +84,12 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, if (!filterList.hasOwnProperty(data)) _registerFilter(data, ' Questions') }) } + + if (widget.meta_data.hasOwnProperty('benefits')) { + widget.meta_data.benefits.forEach(benefit => { + if (!filterList.hasOwnProperty(benefit)) _registerFilter(benefit) + }) + } }) } @@ -91,6 +97,7 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, const _isWidgetVisible = widget => { const wFeatures = widget.meta_data.features const wSupport = widget.meta_data.supported_data + const wBenefit = widget.meta_data.benefits // check for filter matches for (let filterName in filterList) { @@ -99,7 +106,8 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, // widget has features/support and the feature isn't in either if ( (!wFeatures || !wFeatures.includes(filterName)) && - (!wSupport || !wSupport.includes(filterName)) + (!wSupport || !wSupport.includes(filterName)) && + (!wBenefit || !wBenefit.includes(filterName)) ) { return false } diff --git a/src/js/controllers/ctrl-widget-catalog.test.js b/src/js/controllers/ctrl-widget-catalog.test.js index 3a45cb0c..03d7dd5b 100644 --- a/src/js/controllers/ctrl-widget-catalog.test.js +++ b/src/js/controllers/ctrl-widget-catalog.test.js @@ -19,7 +19,8 @@ describe('widgetCatalogController', () => { demo: '1', excerpt: 'more information about the widget', features: ['feature1', 'feature3'], - supported_data: ['supported1', 'supported_three', 'SuPpOrTeD FoUr!!'] + supported_data: ['supported1', 'supported_three', 'SuPpOrTeD FoUr!!'], + benefits: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'] }, name: 'widget1' } @@ -32,7 +33,8 @@ describe('widgetCatalogController', () => { demo: '2', excerpt: 'more information about the widget', features: ['feature2', 'feature3'], - supported_data: ['supported1', 'supported2'] + supported_data: ['supported1', 'supported2'], + benefits: ['niceme.me', 'nicememe.website'] }, name: 'widget2' } @@ -45,7 +47,8 @@ describe('widgetCatalogController', () => { demo: '3', excerpt: 'more information about the widget', features: [], - supported_data: [] + supported_data: [], + benefits: [] }, name: 'widget3' } @@ -204,6 +207,7 @@ describe('widgetCatalogController', () => { // only one widget matches the search and filter options expect($scope.widgets).toHaveLength(1) expect($scope.widgets).toContain(widget1) + expect($scope.widgets[0]).toContain(benefits) expect($scope.filters).toMatchSnapshot() }) diff --git a/src/js/controllers/ctrl-widget-details.js b/src/js/controllers/ctrl-widget-details.js index fdc46126..33d1edbd 100644 --- a/src/js/controllers/ctrl-widget-details.js +++ b/src/js/controllers/ctrl-widget-details.js @@ -50,6 +50,7 @@ app.controller('widgetDetailsController', function( features: widget.meta_data['features'].map(_tooltipObject), creators_guide: document.location.pathname + '/creators-guide', players_guide: document.location.pathname + '/players-guide', + benefits: widget.meta_data['benefits'], created: date.toLocaleDateString(), width: ~~widget.width, height: ~~widget.height @@ -57,6 +58,7 @@ app.controller('widgetDetailsController', function( $scope.hasPlayerGuide = widget.player_guide != '' $scope.hasCreatorGuide = widget.creator_guide != '' + $scope.hasBenefits = widget.benefits != [] // inst_id needs to be set for the embedded demo $scope.inst_id = widget.meta_data.demo diff --git a/src/js/controllers/ctrl-widget-details.test.js b/src/js/controllers/ctrl-widget-details.test.js index ec13109b..b1bde9b3 100644 --- a/src/js/controllers/ctrl-widget-details.test.js +++ b/src/js/controllers/ctrl-widget-details.test.js @@ -22,6 +22,7 @@ describe('widgetDetailsController', () => { about: 'about', supported_data: ['supported1', 'supported2'], features: ['feature1', 'feature2'], + benefits: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'], demo: 'abCD1' }, width: '700', From 89ea3a521b0fe377614600639ce3cbb84224850d Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 28 Jun 2019 15:38:20 -0400 Subject: [PATCH 07/35] added tests for academic benefits --- .../ctrl-widget-catalog.test.js.snap | 15 +++++++++++++-- src/js/controllers/ctrl-widget-catalog.test.js | 7 ++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap index dc86471d..68bff6ce 100644 --- a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap +++ b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap @@ -68,6 +68,11 @@ Object { "isActive": false, "text": "feature3", }, + "https://www.youtube.com/watch?v=dQw4w9WgXcQ": Object { + "clean": "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", + "isActive": false, + "text": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + }, "supported1": Object { "clean": "supported1", "isActive": false, @@ -131,6 +136,11 @@ Object { "isActive": false, "text": "feature3", }, + "https://www.youtube.com/watch?v=dQw4w9WgXcQ": Object { + "clean": "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", + "isActive": false, + "text": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + }, "supported1": Object { "clean": "supported1", "isActive": false, @@ -156,6 +166,7 @@ Array [ "supported1", "supported_three", "su_pp_or_te_d_fo_ur", + "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", "feature2", "supported2", ] @@ -182,8 +193,8 @@ Array [ "SuPpOrTeD FoUr!!", ], "benefits": Array [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ] + "https://www.youtube.com/watch?v=dQw4w9WgXcQ", + ], }, "name": "widget1", }, diff --git a/src/js/controllers/ctrl-widget-catalog.test.js b/src/js/controllers/ctrl-widget-catalog.test.js index 03d7dd5b..dd84ede6 100644 --- a/src/js/controllers/ctrl-widget-catalog.test.js +++ b/src/js/controllers/ctrl-widget-catalog.test.js @@ -33,8 +33,7 @@ describe('widgetCatalogController', () => { demo: '2', excerpt: 'more information about the widget', features: ['feature2', 'feature3'], - supported_data: ['supported1', 'supported2'], - benefits: ['niceme.me', 'nicememe.website'] + supported_data: ['supported1', 'supported2'] }, name: 'widget2' } @@ -47,8 +46,7 @@ describe('widgetCatalogController', () => { demo: '3', excerpt: 'more information about the widget', features: [], - supported_data: [], - benefits: [] + supported_data: [] }, name: 'widget3' } @@ -207,7 +205,6 @@ describe('widgetCatalogController', () => { // only one widget matches the search and filter options expect($scope.widgets).toHaveLength(1) expect($scope.widgets).toContain(widget1) - expect($scope.widgets[0]).toContain(benefits) expect($scope.filters).toMatchSnapshot() }) From fa410f8374c0f47a545a2d3152dc80426990f73f Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 28 Jun 2019 15:46:15 -0400 Subject: [PATCH 08/35] oops wrong branch --- .../ctrl-widget-catalog.test.js.snap | 15 ++------------- src/js/controllers/ctrl-widget-catalog.test.js | 7 +++++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap index 68bff6ce..dc86471d 100644 --- a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap +++ b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap @@ -68,11 +68,6 @@ Object { "isActive": false, "text": "feature3", }, - "https://www.youtube.com/watch?v=dQw4w9WgXcQ": Object { - "clean": "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", - "isActive": false, - "text": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - }, "supported1": Object { "clean": "supported1", "isActive": false, @@ -136,11 +131,6 @@ Object { "isActive": false, "text": "feature3", }, - "https://www.youtube.com/watch?v=dQw4w9WgXcQ": Object { - "clean": "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", - "isActive": false, - "text": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - }, "supported1": Object { "clean": "supported1", "isActive": false, @@ -166,7 +156,6 @@ Array [ "supported1", "supported_three", "su_pp_or_te_d_fo_ur", - "https_www_youtube_com_watch_v_d_qw4w9wg_xc_q", "feature2", "supported2", ] @@ -193,8 +182,8 @@ Array [ "SuPpOrTeD FoUr!!", ], "benefits": Array [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ", - ], + "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + ] }, "name": "widget1", }, diff --git a/src/js/controllers/ctrl-widget-catalog.test.js b/src/js/controllers/ctrl-widget-catalog.test.js index dd84ede6..03d7dd5b 100644 --- a/src/js/controllers/ctrl-widget-catalog.test.js +++ b/src/js/controllers/ctrl-widget-catalog.test.js @@ -33,7 +33,8 @@ describe('widgetCatalogController', () => { demo: '2', excerpt: 'more information about the widget', features: ['feature2', 'feature3'], - supported_data: ['supported1', 'supported2'] + supported_data: ['supported1', 'supported2'], + benefits: ['niceme.me', 'nicememe.website'] }, name: 'widget2' } @@ -46,7 +47,8 @@ describe('widgetCatalogController', () => { demo: '3', excerpt: 'more information about the widget', features: [], - supported_data: [] + supported_data: [], + benefits: [] }, name: 'widget3' } @@ -205,6 +207,7 @@ describe('widgetCatalogController', () => { // only one widget matches the search and filter options expect($scope.widgets).toHaveLength(1) expect($scope.widgets).toContain(widget1) + expect($scope.widgets[0]).toContain(benefits) expect($scope.filters).toMatchSnapshot() }) From dbff5307326ec427ef4c8231948995c393008245 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 28 Jun 2019 15:47:23 -0400 Subject: [PATCH 09/35] Revert "added academic benefits of widgets" --- __test__/mockapi/widget_instances_get.json | 45 ------------------- __test__/mockapi/widgets_get.json | 5 --- src/css/widget-detail.scss | 3 +- .../ctrl-widget-catalog.test.js.snap | 3 -- src/js/controllers/ctrl-widget-catalog.js | 10 +---- .../controllers/ctrl-widget-catalog.test.js | 10 ++--- src/js/controllers/ctrl-widget-details.js | 2 - .../controllers/ctrl-widget-details.test.js | 1 - 8 files changed, 5 insertions(+), 74 deletions(-) diff --git a/__test__/mockapi/widget_instances_get.json b/__test__/mockapi/widget_instances_get.json index c8d61b37..fc4753f4 100644 --- a/__test__/mockapi/widget_instances_get.json +++ b/__test__/mockapi/widget_instances_get.json @@ -424,11 +424,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1058,11 +1053,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1378,11 +1368,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1699,11 +1684,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1767,11 +1747,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1835,11 +1810,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -1903,11 +1873,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -2102,11 +2067,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" @@ -2828,11 +2788,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "2wh8K" diff --git a/__test__/mockapi/widgets_get.json b/__test__/mockapi/widgets_get.json index 644e8d1b..d61d22ed 100644 --- a/__test__/mockapi/widgets_get.json +++ b/__test__/mockapi/widgets_get.json @@ -27,11 +27,6 @@ "supported_data": [ "Question/Answer" ], - "benefits": [ - "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2972511/", - "https://www.archivesofpathology.org/doi/full/10.1043/1543-2165-133.9.1457", - "https://journals.sagepub.com/doi/abs/10.1177/1469787401002002007" - ], "about": "In Crossword, fill in the blank squares with: (a) words based on the clues provided in the text and/or (b) by the letters overlapping from other words.", "excerpt": "A quiz tool that uses words and clues to randomly generate a crossword puzzle.", "demo": "9zBg0" diff --git a/src/css/widget-detail.scss b/src/css/widget-detail.scss index 53d48d87..11993467 100644 --- a/src/css/widget-detail.scss +++ b/src/css/widget-detail.scss @@ -57,8 +57,7 @@ $color-features-active: #0357a5; font-size: 12px; } - .guide-link, - .benefit-link { + .guide-link { font-size: 13px; padding: 2px 25px 2px 6px; border-radius: 2px; diff --git a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap index dc86471d..6d61f89d 100644 --- a/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap +++ b/src/js/controllers/__snapshots__/ctrl-widget-catalog.test.js.snap @@ -181,9 +181,6 @@ Array [ "supported_three", "SuPpOrTeD FoUr!!", ], - "benefits": Array [ - "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - ] }, "name": "widget1", }, diff --git a/src/js/controllers/ctrl-widget-catalog.js b/src/js/controllers/ctrl-widget-catalog.js index 49916bd7..5e87b1ed 100644 --- a/src/js/controllers/ctrl-widget-catalog.js +++ b/src/js/controllers/ctrl-widget-catalog.js @@ -84,12 +84,6 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, if (!filterList.hasOwnProperty(data)) _registerFilter(data, ' Questions') }) } - - if (widget.meta_data.hasOwnProperty('benefits')) { - widget.meta_data.benefits.forEach(benefit => { - if (!filterList.hasOwnProperty(benefit)) _registerFilter(benefit) - }) - } }) } @@ -97,7 +91,6 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, const _isWidgetVisible = widget => { const wFeatures = widget.meta_data.features const wSupport = widget.meta_data.supported_data - const wBenefit = widget.meta_data.benefits // check for filter matches for (let filterName in filterList) { @@ -106,8 +99,7 @@ app.controller('widgetCatalogCtrl', function(Please, $scope, $window, $location, // widget has features/support and the feature isn't in either if ( (!wFeatures || !wFeatures.includes(filterName)) && - (!wSupport || !wSupport.includes(filterName)) && - (!wBenefit || !wBenefit.includes(filterName)) + (!wSupport || !wSupport.includes(filterName)) ) { return false } diff --git a/src/js/controllers/ctrl-widget-catalog.test.js b/src/js/controllers/ctrl-widget-catalog.test.js index 03d7dd5b..3a45cb0c 100644 --- a/src/js/controllers/ctrl-widget-catalog.test.js +++ b/src/js/controllers/ctrl-widget-catalog.test.js @@ -19,8 +19,7 @@ describe('widgetCatalogController', () => { demo: '1', excerpt: 'more information about the widget', features: ['feature1', 'feature3'], - supported_data: ['supported1', 'supported_three', 'SuPpOrTeD FoUr!!'], - benefits: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'] + supported_data: ['supported1', 'supported_three', 'SuPpOrTeD FoUr!!'] }, name: 'widget1' } @@ -33,8 +32,7 @@ describe('widgetCatalogController', () => { demo: '2', excerpt: 'more information about the widget', features: ['feature2', 'feature3'], - supported_data: ['supported1', 'supported2'], - benefits: ['niceme.me', 'nicememe.website'] + supported_data: ['supported1', 'supported2'] }, name: 'widget2' } @@ -47,8 +45,7 @@ describe('widgetCatalogController', () => { demo: '3', excerpt: 'more information about the widget', features: [], - supported_data: [], - benefits: [] + supported_data: [] }, name: 'widget3' } @@ -207,7 +204,6 @@ describe('widgetCatalogController', () => { // only one widget matches the search and filter options expect($scope.widgets).toHaveLength(1) expect($scope.widgets).toContain(widget1) - expect($scope.widgets[0]).toContain(benefits) expect($scope.filters).toMatchSnapshot() }) diff --git a/src/js/controllers/ctrl-widget-details.js b/src/js/controllers/ctrl-widget-details.js index 33d1edbd..fdc46126 100644 --- a/src/js/controllers/ctrl-widget-details.js +++ b/src/js/controllers/ctrl-widget-details.js @@ -50,7 +50,6 @@ app.controller('widgetDetailsController', function( features: widget.meta_data['features'].map(_tooltipObject), creators_guide: document.location.pathname + '/creators-guide', players_guide: document.location.pathname + '/players-guide', - benefits: widget.meta_data['benefits'], created: date.toLocaleDateString(), width: ~~widget.width, height: ~~widget.height @@ -58,7 +57,6 @@ app.controller('widgetDetailsController', function( $scope.hasPlayerGuide = widget.player_guide != '' $scope.hasCreatorGuide = widget.creator_guide != '' - $scope.hasBenefits = widget.benefits != [] // inst_id needs to be set for the embedded demo $scope.inst_id = widget.meta_data.demo diff --git a/src/js/controllers/ctrl-widget-details.test.js b/src/js/controllers/ctrl-widget-details.test.js index b1bde9b3..ec13109b 100644 --- a/src/js/controllers/ctrl-widget-details.test.js +++ b/src/js/controllers/ctrl-widget-details.test.js @@ -22,7 +22,6 @@ describe('widgetDetailsController', () => { about: 'about', supported_data: ['supported1', 'supported2'], features: ['feature1', 'feature2'], - benefits: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'], demo: 'abCD1' }, width: '700', From 10af7e6c84dcaddaceed7633c3303b5a794dc53f Mon Sep 17 00:00:00 2001 From: Weining Li Date: Mon, 1 Jul 2019 09:54:36 -0400 Subject: [PATCH 10/35] added list of access levels for collaboration dropdown list --- src/js/controllers/ctrl-collaboration.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/controllers/ctrl-collaboration.js b/src/js/controllers/ctrl-collaboration.js index d5541ca6..97e09923 100644 --- a/src/js/controllers/ctrl-collaboration.js +++ b/src/js/controllers/ctrl-collaboration.js @@ -268,6 +268,12 @@ app.controller('CollaborationController', function( VISIBLE: ACCESS.VISIBLE, FULL: ACCESS.FULL } + $scope.accessLevels = [ + { value: ACCESS.VISIBLE, text: 'View Scores' }, + { value: ACCESS.FULL, text: 'Full' } + ] + $scope.selectedAccessLevel = $scope.accessLevels[0] + $scope.alert = Alert $scope.search = _search $scope.updatePermissions = _updatePermissions From b5e05eb2d3db5da12bf1257507874e2e0434d26f Mon Sep 17 00:00:00 2001 From: Weining Li Date: Mon, 1 Jul 2019 10:27:43 -0400 Subject: [PATCH 11/35] 'fixed' coverage issue --- src/js/controllers/ctrl-collaboration.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/controllers/ctrl-collaboration.js b/src/js/controllers/ctrl-collaboration.js index 97e09923..c6cfda57 100644 --- a/src/js/controllers/ctrl-collaboration.js +++ b/src/js/controllers/ctrl-collaboration.js @@ -272,7 +272,6 @@ app.controller('CollaborationController', function( { value: ACCESS.VISIBLE, text: 'View Scores' }, { value: ACCESS.FULL, text: 'Full' } ] - $scope.selectedAccessLevel = $scope.accessLevels[0] $scope.alert = Alert $scope.search = _search From 50b89c07184aa4930eb7789260cf50871f5ea6f5 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Mon, 1 Jul 2019 15:52:17 -0400 Subject: [PATCH 12/35] fixed select issues --- src/js/controllers/ctrl-collaboration.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/controllers/ctrl-collaboration.js b/src/js/controllers/ctrl-collaboration.js index c6cfda57..072201cf 100644 --- a/src/js/controllers/ctrl-collaboration.js +++ b/src/js/controllers/ctrl-collaboration.js @@ -269,10 +269,9 @@ app.controller('CollaborationController', function( FULL: ACCESS.FULL } $scope.accessLevels = [ - { value: ACCESS.VISIBLE, text: 'View Scores' }, - { value: ACCESS.FULL, text: 'Full' } + { value: ACCESS.FULL, text: 'Full' }, + { value: ACCESS.VISIBLE, text: 'View Scores' } ] - $scope.alert = Alert $scope.search = _search $scope.updatePermissions = _updatePermissions From 9f9b0a187661671dafb9b30fb2feca8cb4f115eb Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 5 Jul 2019 08:25:31 -0400 Subject: [PATCH 13/35] use object for accessLevels instead of array --- src/js/controllers/ctrl-collaboration.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/controllers/ctrl-collaboration.js b/src/js/controllers/ctrl-collaboration.js index 072201cf..712b1b4b 100644 --- a/src/js/controllers/ctrl-collaboration.js +++ b/src/js/controllers/ctrl-collaboration.js @@ -164,7 +164,7 @@ app.controller('CollaborationController', function( first: user.first, last: user.last, gravatar: user.gravatar, - access: ACCESS.VISIBLE + access: String(ACCESS.VISIBLE) }) $timeout(() => { @@ -268,10 +268,10 @@ app.controller('CollaborationController', function( VISIBLE: ACCESS.VISIBLE, FULL: ACCESS.FULL } - $scope.accessLevels = [ - { value: ACCESS.FULL, text: 'Full' }, - { value: ACCESS.VISIBLE, text: 'View Scores' } - ] + $scope.accessLevels = {} + $scope.accessLevels[ACCESS.VISIBLE] = { value: ACCESS.VISIBLE, text: 'View Scores' } + $scope.accessLevels[ACCESS.FULL] = { value: ACCESS.FULL, text: 'Full' } + $scope.alert = Alert $scope.search = _search $scope.updatePermissions = _updatePermissions From 7b215dcfa000108b46a328303c08f216269ffef0 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 5 Jul 2019 09:17:24 -0400 Subject: [PATCH 14/35] added some tests for accessLevels object --- src/js/controllers/ctrl-collaboration.test.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/js/controllers/ctrl-collaboration.test.js diff --git a/src/js/controllers/ctrl-collaboration.test.js b/src/js/controllers/ctrl-collaboration.test.js new file mode 100644 index 00000000..039da5ff --- /dev/null +++ b/src/js/controllers/ctrl-collaboration.test.js @@ -0,0 +1,41 @@ +describe('CollaborationController', () => { + let $controller + var mockPlease + let $scope + + beforeEach(() => { + mockPlease = { $apply: jest.fn() } + let app = angular.module('materia') + app.factory('Please', () => mockPlease) + + require('../materia-namespace') + require('../materia-constants') + require('../materia/materia.coms.json') + require('../services/srv-selectedwidget') + require('../services/srv-datetime') + require('../services/srv-widget') + require('../services/srv-user') + require('ngmodal/dist/ng-modal') + require('hammerjs') + require('./ctrl-alert') + require('./ctrl-collaboration') + + inject(_$controller_ => { + $controller = _$controller_ + }) + + $scope = { + $watch: jest.fn(), + $on: jest.fn() + } + }) + + it('defines expected scope vars - accessLevels', () => { + $controller('CollaborationController', { $scope }) + expect($scope.accessLevels).toHaveProperty('1') + expect($scope.accessLevels).toHaveProperty('30') + expect($scope.accessLevels[1]).toHaveProperty('text') + expect($scope.accessLevels[1].text).toBe('View Scores') + expect($scope.accessLevels[30].value).toBe(30) + }) +}) From 9b7fd08eef97e29dfa4fe6242ce1d8d6a4ab4041 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Tue, 9 Jul 2019 10:07:42 -0400 Subject: [PATCH 15/35] Remove unnecessary classes and add external link css --- src/css/util-lti-picker.scss | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/css/util-lti-picker.scss b/src/css/util-lti-picker.scss index e9a4c039..bfca8325 100644 --- a/src/css/util-lti-picker.scss +++ b/src/css/util-lti-picker.scss @@ -223,17 +223,6 @@ header > h1 { bottom: 10px; } -#list-container li .view-at-materia { - display: none; - position: absolute; - right: 20px; - top: 10px; -} -#list-container li:hover .view-at-materia, -#list-container li.selected .view-at-materia { - display: block; -} - #list-container li .embed-button { display: none; position: absolute; @@ -243,6 +232,13 @@ header > h1 { #list-container li:hover .embed-button, #list-container li.selected .embed-button { display: inline-block; + + div { + display: inline-block; + width: 12px; + height: 12px; + background: url(../../../img/external_link_arrow_brown.png) 0% 0% no-repeat; + } } #select-widget .widget-icon { From 11e13ad6a436695f42f654595311c42f00821018 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 12 Jul 2019 11:56:10 -0400 Subject: [PATCH 16/35] added export option for referrer data --- src/js/controllers/ctrl-export-scores.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/ctrl-export-scores.js b/src/js/controllers/ctrl-export-scores.js index 582187db..65756acd 100644 --- a/src/js/controllers/ctrl-export-scores.js +++ b/src/js/controllers/ctrl-export-scores.js @@ -8,6 +8,7 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget if ($scope.selected.scores.list.length === 0 || !$scope.selected.hasScores) { $scope.exportOpts = ['Questions and Answers'] + $scope.exportOpts.push('Referrer Links') } else { let scores_only if (wgt.guest_access) { @@ -15,7 +16,7 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget } else { scores_only = 'High Scores' } - $scope.exportOpts = [scores_only, 'Full Event Log', 'Questions and Answers'] + $scope.exportOpts = [scores_only, 'Full Event Log', 'Questions and Answers', 'Referrer Links'] if ( (wgt.widget.meta_data.playdata_exporters != null ? wgt.widget.meta_data.playdata_exporters.length From 6c1bb63de9023dcd76f192650b03a82dc2f67358 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2019 14:17:16 +0000 Subject: [PATCH 17/35] Bump lodash from 4.17.11 to 4.17.14 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index daebf8c7..a8abfe25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4283,9 +4283,9 @@ lodash.uniq@^4.5.0: integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= lodash@^4.0.0, lodash@^4.17.11, lodash@~4.17.10: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== log-symbols@^1.0.2: version "1.0.2" From 23f05e10e4e745c6cbc7a84d7ddadd493495d687 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Mon, 15 Jul 2019 10:02:12 -0400 Subject: [PATCH 18/35] Add check for if there are no semesters --- src/js/controllers/ctrl-export-scores.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/ctrl-export-scores.js b/src/js/controllers/ctrl-export-scores.js index 582187db..f2c30022 100644 --- a/src/js/controllers/ctrl-export-scores.js +++ b/src/js/controllers/ctrl-export-scores.js @@ -47,8 +47,11 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget }) } - // First semester is checked by default - $scope.semesters[0].checked = true + // First semester is checked by default unless there are no semesters + if ($scope.semesters.length !== 0) { + $scope.semesters[0].checked = true + } + $scope.onSelectedSemestersChange() Please.$apply() }) From f9fc8293bd57a0ef887bb94658e512c5d2237f9c Mon Sep 17 00:00:00 2001 From: Weining Li Date: Mon, 15 Jul 2019 16:12:50 -0400 Subject: [PATCH 19/35] removed group field from widgets --- __test__/mockapi/widget_instances_get.json | 49 ---------------------- __test__/mockapi/widgets_get.json | 1 - 2 files changed, 50 deletions(-) diff --git a/__test__/mockapi/widget_instances_get.json b/__test__/mockapi/widget_instances_get.json index fc4753f4..7f5858f1 100644 --- a/__test__/mockapi/widget_instances_get.json +++ b/__test__/mockapi/widget_instances_get.json @@ -25,7 +25,6 @@ "dir": "70-mental-rotation-body-parts/", "flash_version": "0", "api_version": "2", - "group": "Popup", "height": "600", "id": "70", "is_answer_encrypted": "1", @@ -85,7 +84,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -149,7 +147,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -213,7 +210,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -277,7 +273,6 @@ "dir": "13-last-chance-cadet/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "593", "id": "13", "is_answer_encrypted": "1", @@ -340,7 +335,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -403,7 +397,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -466,7 +459,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -529,7 +521,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -592,7 +583,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -655,7 +645,6 @@ "dir": "80-this-or-that/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "0", "id": "80", "is_answer_encrypted": "1", @@ -719,7 +708,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -783,7 +771,6 @@ "dir": "98-equation-sandbox/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "650", "id": "98", "is_answer_encrypted": "1", @@ -846,7 +833,6 @@ "dir": "12-hangman/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "620", "id": "12", "is_answer_encrypted": "1", @@ -909,7 +895,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -972,7 +957,6 @@ "dir": "64-what-do-you-believe/", "flash_version": "0", "api_version": "2", - "group": "Popup", "height": "600", "id": "64", "is_answer_encrypted": "1", @@ -1032,7 +1016,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1095,7 +1078,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1158,7 +1140,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1221,7 +1202,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1284,7 +1264,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1347,7 +1326,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1410,7 +1388,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -1474,7 +1451,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1537,7 +1513,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1600,7 +1575,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -1663,7 +1637,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1726,7 +1699,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1789,7 +1761,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1852,7 +1823,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -1915,7 +1885,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -1982,7 +1951,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -2046,7 +2014,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -2109,7 +2076,6 @@ "dir": "17-sequencer/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "548", "id": "17", "is_answer_encrypted": "1", @@ -2172,7 +2138,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2239,7 +2204,6 @@ "dir": "13-last-chance-cadet/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "593", "id": "13", "is_answer_encrypted": "1", @@ -2302,7 +2266,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2369,7 +2332,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2436,7 +2398,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2503,7 +2464,6 @@ "dir": "9-flash-cards/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "516", "id": "9", "is_answer_encrypted": "1", @@ -2566,7 +2526,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2633,7 +2592,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2700,7 +2658,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2767,7 +2724,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", @@ -2830,7 +2786,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2897,7 +2852,6 @@ "dir": "18-adventure/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "593", "id": "18", "is_answer_encrypted": "1", @@ -2964,7 +2918,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", @@ -3027,7 +2980,6 @@ "dir": "16-labeling/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "601", "id": "16", "is_answer_encrypted": "1", @@ -3091,7 +3043,6 @@ "dir": "8-enigma/", "flash_version": "0", "api_version": "2", - "group": "Materia", "height": "548", "id": "8", "is_answer_encrypted": "1", diff --git a/__test__/mockapi/widgets_get.json b/__test__/mockapi/widgets_get.json index d61d22ed..cd1bd3f5 100644 --- a/__test__/mockapi/widgets_get.json +++ b/__test__/mockapi/widgets_get.json @@ -6,7 +6,6 @@ "dir": "10-crossword/", "flash_version": "10", "api_version": "2", - "group": "Materia", "height": "592", "id": "10", "is_answer_encrypted": "1", From f53ec7cfdeb02340837a7b358c87db619f58cb7b Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Thu, 18 Jul 2019 10:25:28 -0400 Subject: [PATCH 20/35] Minor tweaks to styling in helper-docs frame --- src/css/widget-guide.scss | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/css/widget-guide.scss b/src/css/widget-guide.scss index b80a5985..202177d5 100644 --- a/src/css/widget-guide.scss +++ b/src/css/widget-guide.scss @@ -5,6 +5,8 @@ padding: 10px; border-radius: 10px; box-shadow: 1px 3px 10px #888; + + font-family: 'Lato', arial, serif; } #top { @@ -20,19 +22,19 @@ &.players-guide { a:first-of-type { - background: #333; + background: #1778af; } } &.creators-guide { a:nth-of-type(2) { - background: #333; + background: #1778af; } } a { padding: 8px 15px; - background: lighten(#333, 20%); + background: #004268; color: white; border-radius: 10px 10px 0 0; margin: 15px 0 0 10px; @@ -46,7 +48,7 @@ width: 100%; box-sizing: border-box; border-radius: 3px 0 3px 3px; - border: 8px solid #333; + border: 8px solid #1778af; } } } From 05f6e966727380087fe7d9d1883a2e8f4017d547 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Fri, 19 Jul 2019 09:01:53 -0400 Subject: [PATCH 21/35] Update text and image positions --- src/css/core.scss | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 176766cc..302e9639 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -74,12 +74,7 @@ header { img { width: 28px; height: 28px; - } - - br { - display: block; - content: ''; - margin-top: -10px; + border-radius: 2px; } span { @@ -89,10 +84,21 @@ header { a { span { - display: inline; - position: static; + text-align: right; + position: absolute; + top: 6px; + width: 500px; + } + span:hover { + text-decoration: underline; } } + + .logout { + position: absolute; + top: 21px; + font-size: 10px; + } } .user { color: #979696; @@ -101,7 +107,7 @@ header { top: 36px; } .user.avatar { - top: 28px; + top: 24px; } } @@ -197,7 +203,7 @@ nav { .user.avatar { right: 62px; - top: 35px; + top: 25px; max-width: calc(100% - 185px); span { @@ -209,6 +215,7 @@ nav { margin: right; height: 35px; width: 35px; + border-radius: 3px; } } } From bbfcc96402dbc6af5b3320a9109f0031d916f694 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Fri, 19 Jul 2019 15:28:29 -0400 Subject: [PATCH 22/35] Add word-break for long one word titles --- src/css/my-widgets.scss | 1 + src/css/util-lti-picker.scss | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/css/my-widgets.scss b/src/css/my-widgets.scss index 3070c90e..202b0109 100644 --- a/src/css/my-widgets.scss +++ b/src/css/my-widgets.scss @@ -255,6 +255,7 @@ font-weight: 900; font-size: 25px; padding-right: 10px; + word-break: break-all; } .page .header h2 { margin: 0; diff --git a/src/css/util-lti-picker.scss b/src/css/util-lti-picker.scss index bfca8325..c0cbe22d 100644 --- a/src/css/util-lti-picker.scss +++ b/src/css/util-lti-picker.scss @@ -223,6 +223,10 @@ header > h1 { bottom: 10px; } +#list-container li .searchable { + word-break: break-all; +} + #list-container li .embed-button { display: none; position: absolute; From 88b186dbf314497d049c6bd4bc46fecb67802bc0 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Fri, 19 Jul 2019 17:18:41 -0400 Subject: [PATCH 23/35] Fix positioning --- src/css/core.scss | 68 ++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 302e9639..1ab859c2 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -81,34 +81,48 @@ header { position: absolute; right: 32px; } + } + .user { + color: #979696; + font-size: 12px; + position: absolute; + top: 36px; + } + .user.avatar { + top: 24px; a { + font-size: 16px; + position: absolute; + top: 36px; + right: 5px; + width: 500px; + text-align: right; + span { text-align: right; position: absolute; - top: 6px; + top: -28px; + right: 38px; width: 500px; + font-size: 12px; } span:hover { text-decoration: underline; } - } - .logout { - position: absolute; - top: 21px; + img { + position: absolute; + top: -35px; + right: 2px; + } + } + .logout a { font-size: 10px; + top: 22px; + right: 12px; } } - .user { - color: #979696; - font-size: 12px; - position: absolute; - top: 36px; - } - .user.avatar { - top: 24px; - } } h1.logo { @@ -169,7 +183,8 @@ nav { display: inline; padding: 0 10px 0 0; - &.logout a { + .logout a { + display: none; position: absolute; right: 20px; bottom: 13px; @@ -202,20 +217,24 @@ nav { } .user.avatar { - right: 62px; - top: 25px; + right: 54px; max-width: calc(100% - 185px); span { display: none; } - img { - float: none; - margin: right; - height: 35px; - width: 35px; - border-radius: 3px; + a { + top: 18px; + + img { + float: none; + margin: right; + height: 35px; + width: 35px; + border-radius: 3px; + top: -17px; + } } } } @@ -251,7 +270,8 @@ nav { } } - &.logout a { + .logout a { + display: inline; font-size: 14px; position: static; } From 0c9e33cb65d91d8e594daadd577a714c6885ae24 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Tue, 23 Jul 2019 08:30:19 -0400 Subject: [PATCH 24/35] Fix incorrect fonts and font sizes --- src/css/core.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 1ab859c2..56901ee3 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -92,7 +92,9 @@ header { top: 24px; a { - font-size: 16px; + font-size: 17px; + font-weight: bold; + font-family: 'Lato', arial, serif; position: absolute; top: 36px; right: 5px; @@ -272,7 +274,7 @@ nav { .logout a { display: inline; - font-size: 14px; + font-size: 17px; position: static; } From f371560a7137a804890cdb8c883b55f9386c0abe Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Tue, 23 Jul 2019 09:12:31 -0400 Subject: [PATCH 25/35] Left align export help paragraph and adjust margins to stop overflow --- src/css/my-widgets.scss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/css/my-widgets.scss b/src/css/my-widgets.scss index 3070c90e..19a1a818 100644 --- a/src/css/my-widgets.scss +++ b/src/css/my-widgets.scss @@ -1208,6 +1208,10 @@ margin: 9px 0px 0px 0px; padding: 0px 10px; text-align: center; + + p:not(.download) { + text-align: left; + } } .ng-modal.csv_popup div.score_table p.download a { @@ -1219,7 +1223,7 @@ text-align: left; padding: 0px 15px 0px 15px; line-height: 1.5em; - margin-top: 40px; + margin-top: 20px; } .ng-modal.csv_popup h4 { @@ -1278,7 +1282,6 @@ text-decoration: underline; } .ng-modal.csv_popup select { - margin-top: 30px; margin-bottom: -10px; } .ng-modal.csv_popup table tr td { From b9d1093979e81a06c6e1f57091d0d9c43e0381d5 Mon Sep 17 00:00:00 2001 From: Weining Li Date: Fri, 26 Jul 2019 10:50:59 -0400 Subject: [PATCH 26/35] allow participation score to be set to a specific value --- src/js/materia/materia.score.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index dbe84557..0908e5fe 100644 --- a/src/js/materia/materia.score.js +++ b/src/js/materia/materia.score.js @@ -39,8 +39,8 @@ Namespace('Materia').Score = (() => { // A participation score submission // This logs a participation grade for unscorable widgets. // @param questionID the ID of the question being answered - const submitUnscorableForParticipation = () => - Materia.Engine.addLog(UNSCORABLE, -1, 'Participation', 100) + const submitUnscorableForParticipation = (value = 100) => + Materia.Engine.addLog(UNSCORABLE, -1, 'Participation', value) // Adds a message/feedback to the overall score screen const addGlobalScoreFeedback = msg => Materia.Engine.addLog(SCORE_FEEDBACK, '0', msg) From cf910545ebf9c5a9a310b9858c33b30ded294445 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Fri, 26 Jul 2019 16:34:19 -0400 Subject: [PATCH 27/35] Add POST request check --- src/js/materia/materia.enginecore.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/materia/materia.enginecore.js b/src/js/materia/materia.enginecore.js index 86782e86..3a718a3d 100644 --- a/src/js/materia/materia.enginecore.js +++ b/src/js/materia/materia.enginecore.js @@ -7,6 +7,7 @@ Namespace('Materia').Engine = (() => { let _widgetClass = null const _onPostMessage = e => { + if (typeof e.data !== 'string') return const msg = JSON.parse(e.data) switch (msg.type) { case 'initWidget': From f9c94639f4d1fe029bdf85422a8acf9d53e6e8e2 Mon Sep 17 00:00:00 2001 From: Davis Goff Date: Tue, 30 Jul 2019 10:01:14 -0400 Subject: [PATCH 28/35] Add post message data check to creatorcore and add tests --- src/js/materia/materia.creatorcore.js | 1 + src/js/materia/materia.creatorcore.test.js | 6 ++++++ src/js/materia/materia.enginecore.test.js | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/src/js/materia/materia.creatorcore.js b/src/js/materia/materia.creatorcore.js index 3d1ffc9b..c7fa1b23 100644 --- a/src/js/materia/materia.creatorcore.js +++ b/src/js/materia/materia.creatorcore.js @@ -6,6 +6,7 @@ Namespace('Materia').CreatorCore = (() => { let _resizeInterval = null const _onPostMessage = e => { + if (typeof e.data !== 'string') return const msg = JSON.parse(e.data) switch (msg.type) { case 'initNewWidget': diff --git a/src/js/materia/materia.creatorcore.test.js b/src/js/materia/materia.creatorcore.test.js index a45844fd..9329554b 100644 --- a/src/js/materia/materia.creatorcore.test.js +++ b/src/js/materia/materia.creatorcore.test.js @@ -152,6 +152,12 @@ describe('creatorcore', () => { expectOnlyCreatorMethodCalledToBe('onQuestionImportComplete') }) + it('reacts properly to post messages with non-string data', () => { + mockPostMessageFromWidget('', '', undefined) + console.log(window.addEventListener) + expect(window.addEventListener).toHaveLastReturnedWith(undefined) + }) + it('reacts properly to unknown post messages', () => { jest.spyOn(console, 'warn') mockPostMessageFromWidget('undefinedMessageType', 'unknown-source', ['payload']) diff --git a/src/js/materia/materia.enginecore.test.js b/src/js/materia/materia.enginecore.test.js index 34c7e515..48f95c27 100644 --- a/src/js/materia/materia.enginecore.test.js +++ b/src/js/materia/materia.enginecore.test.js @@ -101,6 +101,15 @@ describe('enginecore', () => { expect(Engine.getMediaUrl('fR93X')).toBe('mediaUrl/fR93X') }) + it('reacts properly to post messages with non-string data', () => { + Engine.start({ start: jest.fn() }) + let _onPostMessage = window.addEventListener.mock.calls[0][1] + _onPostMessage({ + data: undefined + }) + expect(parent.postMessage).toHaveLastReturnedWith(undefined) + }) + it('end sends post message and defaults to show score screen', () => { Engine.end() let ex = JSON.stringify({ From d70d486115a0d0fa47cbd5f0739ccd6f1a2bf212 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Mon, 5 Aug 2019 13:23:54 -0400 Subject: [PATCH 29/35] v2.1.0-alpha1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 265c83fa..26c0361b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "materia-server-client-assets", - "version": "2.0.0", + "version": "2.1.0-alpha1", "license": "AGPL-3.0", "description": "Materia Server Client Assets contains all the javascript and css for Materia Server and the Materia Widget Development Kit.", "author": "University of Central Florida, Center for Distributed Learning", From b693e976152953e3e6e628d1d8d69734aaf7206a Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Thu, 8 Aug 2019 13:53:19 -0400 Subject: [PATCH 30/35] nudged notifications icon to keep it from obscuring logout button --- src/css/core.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 56901ee3..e6030b82 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -656,7 +656,7 @@ h3 { } #notifications_link.selected { position: absolute; - right: 80px; + right: 120px; bottom: 5px; z-index: 110; @@ -676,8 +676,8 @@ h3 { content: attr(data-notifications); position: absolute; - top: -1.5em; - right: -1em; + top: 0.5em; + right: -1.25em; min-width: 1.5em; min-height: 1.5em; From 3a62acf4451d7b15e570a83efd6c89c49d51a0f3 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Thu, 8 Aug 2019 15:36:16 -0400 Subject: [PATCH 31/35] v2.1.0-alpha2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26c0361b..4b3ad9e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "materia-server-client-assets", - "version": "2.1.0-alpha1", + "version": "2.1.0-alpha2", "license": "AGPL-3.0", "description": "Materia Server Client Assets contains all the javascript and css for Materia Server and the Materia Widget Development Kit.", "author": "University of Central Florida, Center for Distributed Learning", From 49cbcac39c9806f40b68d0948791588f8821f763 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Mon, 19 Aug 2019 16:12:19 -0400 Subject: [PATCH 32/35] CSS tweaks to user header --- src/css/core.scss | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index e6030b82..6b3cdd3e 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -72,8 +72,8 @@ header { line-height: 0; img { - width: 28px; - height: 28px; + width: 34px; + height: 34px; border-radius: 2px; } @@ -105,9 +105,9 @@ header { text-align: right; position: absolute; top: -28px; - right: 38px; + right: 42px; width: 500px; - font-size: 12px; + font-size: 14px; } span:hover { text-decoration: underline; @@ -120,9 +120,10 @@ header { } } .logout a { - font-size: 10px; - top: 22px; - right: 12px; + font-size: 14px; + top: 26px; + right: 18px; + font-weight: 400; } } } @@ -640,7 +641,7 @@ h3 { #notifications_link { position: absolute; - right: 86px; + right: 120px; bottom: 16px; width: 30px; @@ -656,7 +657,7 @@ h3 { } #notifications_link.selected { position: absolute; - right: 120px; + right: 80px; bottom: 5px; z-index: 110; From 5830590b92be55e6b70a74c847dcb1db1d862112 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Tue, 20 Aug 2019 15:55:27 -0400 Subject: [PATCH 33/35] CSS tweaks & refactored references to SCORE_PARTICIPATION --- src/css/core.scss | 4 ++-- src/js/controllers/ctrl-export-scores.js | 4 ++-- src/js/materia/materia.score.js | 10 +++++----- src/js/materia/materia.score.test.js | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/css/core.scss b/src/css/core.scss index 6b3cdd3e..28b8c4c9 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -72,8 +72,8 @@ header { line-height: 0; img { - width: 34px; - height: 34px; + width: 35px; + height: 35px; border-radius: 2px; } diff --git a/src/js/controllers/ctrl-export-scores.js b/src/js/controllers/ctrl-export-scores.js index e3089fab..af521812 100644 --- a/src/js/controllers/ctrl-export-scores.js +++ b/src/js/controllers/ctrl-export-scores.js @@ -8,7 +8,7 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget if ($scope.selected.scores.list.length === 0 || !$scope.selected.hasScores) { $scope.exportOpts = ['Questions and Answers'] - $scope.exportOpts.push('Referrer Links') + $scope.exportOpts.push('Referrer URLs') } else { let scores_only if (wgt.guest_access) { @@ -16,7 +16,7 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget } else { scores_only = 'High Scores' } - $scope.exportOpts = [scores_only, 'Full Event Log', 'Questions and Answers', 'Referrer Links'] + $scope.exportOpts = [scores_only, 'Full Event Log', 'Questions and Answers', 'Referrer URLs'] if ( (wgt.widget.meta_data.playdata_exporters != null ? wgt.widget.meta_data.playdata_exporters.length diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index 0908e5fe..d44f0e55 100644 --- a/src/js/materia/materia.score.js +++ b/src/js/materia/materia.score.js @@ -3,7 +3,7 @@ Namespace('Materia').Score = (() => { const WIDGET_INTERACTION_UNSCORED = 1001 // any (scorable) widget intraction beyond a basic answered question. Includes question adjustments, overall adjustments, etc const FINAL_SCORE_FROM_CLIENT = 1002 // a final score from the widget const QUESTION_ANSWERED_UNSCORED = 1004 // a basic answered question (e.g., 'what color is the sky?' 'blue') - const UNSCORABLE = 1006 // an unscorable widget + const SCORE_PARTICIPATION = 1006 // a non-scored widget can return a "participation score" if it chooses to const SCORE_FEEDBACK = 1008 // attaches a feedback message to a question (or game if qid is 0) const DATA = 2000 @@ -37,10 +37,10 @@ Namespace('Materia').Score = (() => { Materia.Engine.addLog(QUESTION_ANSWERED_UNSCORED, questionID, userAnswer, value) // A participation score submission - // This logs a participation grade for unscorable widgets. + // This logs a participation grade for non-scorable widgets. // @param questionID the ID of the question being answered - const submitUnscorableForParticipation = (value = 100) => - Materia.Engine.addLog(UNSCORABLE, -1, 'Participation', value) + const submitScoreForParticipation = (value = 100) => + Materia.Engine.addLog(SCORE_PARTICIPATION, -1, 'Participation', value) // Adds a message/feedback to the overall score screen const addGlobalScoreFeedback = msg => Materia.Engine.addLog(SCORE_FEEDBACK, '0', msg) @@ -51,7 +51,7 @@ Namespace('Materia').Score = (() => { submitInteractionForScoring, submitFinalScoreFromClient, submitQuestionForScoring, - submitUnscorableForParticipation, + submitScoreForParticipation, addGlobalScoreFeedback, addScoreData } diff --git a/src/js/materia/materia.score.test.js b/src/js/materia/materia.score.test.js index abbf2402..a83cd416 100644 --- a/src/js/materia/materia.score.test.js +++ b/src/js/materia/materia.score.test.js @@ -13,7 +13,7 @@ describe('Materia.Score', () => { expect(Score.submitInteractionForScoring).toBeDefined() expect(Score.submitFinalScoreFromClient).toBeDefined() expect(Score.submitQuestionForScoring).toBeDefined() - expect(Score.submitUnscorableForParticipation).toBeDefined() + expect(Score.submitScoreForParticipation).toBeDefined() expect(Score.addGlobalScoreFeedback).toBeDefined() expect(Score.addScoreData).toBeDefined() }) @@ -28,8 +28,8 @@ describe('Materia.Score', () => { expect(mockAddLog).toHaveBeenLastCalledWith(1008, '0', 'my message') }) - it('submitUnscorableForParticipation calls addLog', () => { - Score.submitUnscorableForParticipation() + it('submitScoreForParticipation calls addLog', () => { + Score.submitScoreForParticipation() expect(mockAddLog).toHaveBeenLastCalledWith(1006, -1, 'Participation', 100) }) From 9bb013875c67f3933b6b3ca648c4f2d6f3e43e30 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Tue, 20 Aug 2019 16:18:10 -0400 Subject: [PATCH 34/35] v2.1.0-alpha3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b3ad9e7..f309c014 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "materia-server-client-assets", - "version": "2.1.0-alpha2", + "version": "2.1.0-alpha3", "license": "AGPL-3.0", "description": "Materia Server Client Assets contains all the javascript and css for Materia Server and the Materia Widget Development Kit.", "author": "University of Central Florida, Center for Distributed Learning", From b92746a84be923a78fca9e41ca837dec6ae2d507 Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Fri, 23 Aug 2019 13:02:01 -0400 Subject: [PATCH 35/35] Cleaned exportOpts array definition --- src/js/controllers/ctrl-export-scores.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/controllers/ctrl-export-scores.js b/src/js/controllers/ctrl-export-scores.js index af521812..3e3f9d17 100644 --- a/src/js/controllers/ctrl-export-scores.js +++ b/src/js/controllers/ctrl-export-scores.js @@ -7,8 +7,7 @@ app.controller('ExportScoresController', function(Please, $scope, selectedWidget $scope.selectedId = wgt.id if ($scope.selected.scores.list.length === 0 || !$scope.selected.hasScores) { - $scope.exportOpts = ['Questions and Answers'] - $scope.exportOpts.push('Referrer URLs') + $scope.exportOpts = ['Questions and Answers', 'Referrer URLs'] } else { let scores_only if (wgt.guest_access) {