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", diff --git a/package.json b/package.json index 265c83fa..f309c014 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "materia-server-client-assets", - "version": "2.0.0", + "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", diff --git a/src/css/core.scss b/src/css/core.scss index 5e31dec2..28b8c4c9 100644 --- a/src/css/core.scss +++ b/src/css/core.scss @@ -60,13 +60,26 @@ 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; - display: block; + width: 35px; + height: 35px; + border-radius: 2px; + } + + span { + position: absolute; + right: 32px; } } .user { @@ -76,13 +89,42 @@ header { top: 36px; } .user.avatar { - top: 12px; - } + top: 24px; - ul, - p { - margin: 0; - padding: 0; + a { + font-size: 17px; + font-weight: bold; + font-family: 'Lato', arial, serif; + position: absolute; + top: 36px; + right: 5px; + width: 500px; + text-align: right; + + span { + text-align: right; + position: absolute; + top: -28px; + right: 42px; + width: 500px; + font-size: 14px; + } + span:hover { + text-decoration: underline; + } + + img { + position: absolute; + top: -35px; + right: 2px; + } + } + .logout a { + font-size: 14px; + top: 26px; + right: 18px; + font-weight: 400; + } } } @@ -144,7 +186,8 @@ nav { display: inline; padding: 0 10px 0 0; - &.logout a { + .logout a { + display: none; position: absolute; right: 20px; bottom: 13px; @@ -177,9 +220,25 @@ nav { } .user.avatar { - position: static; - display: inline-block; + right: 54px; max-width: calc(100% - 185px); + + span { + display: none; + } + + a { + top: 18px; + + img { + float: none; + margin: right; + height: 35px; + width: 35px; + border-radius: 3px; + top: -17px; + } + } } } @@ -214,8 +273,9 @@ nav { } } - &.logout a { - font-size: 14px; + .logout a { + display: inline; + font-size: 17px; position: static; } @@ -581,7 +641,7 @@ h3 { #notifications_link { position: absolute; - right: 86px; + right: 120px; bottom: 16px; width: 30px; @@ -617,8 +677,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; diff --git a/src/css/my-widgets.scss b/src/css/my-widgets.scss index 3070c90e..df3b70e5 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; @@ -1208,6 +1209,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 +1224,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 +1283,6 @@ text-decoration: underline; } .ng-modal.csv_popup select { - margin-top: 30px; margin-bottom: -10px; } .ng-modal.csv_popup table tr td { diff --git a/src/css/util-lti-picker.scss b/src/css/util-lti-picker.scss index e9a4c039..c0cbe22d 100644 --- a/src/css/util-lti-picker.scss +++ b/src/css/util-lti-picker.scss @@ -223,15 +223,8 @@ 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 .searchable { + word-break: break-all; } #list-container li .embed-button { @@ -243,6 +236,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 { 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; } } } diff --git a/src/js/controllers/ctrl-collaboration.js b/src/js/controllers/ctrl-collaboration.js index d5541ca6..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,6 +268,10 @@ app.controller('CollaborationController', function( VISIBLE: ACCESS.VISIBLE, FULL: ACCESS.FULL } + $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 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) + }) +}) diff --git a/src/js/controllers/ctrl-export-scores.js b/src/js/controllers/ctrl-export-scores.js index 582187db..3e3f9d17 100644 --- a/src/js/controllers/ctrl-export-scores.js +++ b/src/js/controllers/ctrl-export-scores.js @@ -7,7 +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 = ['Questions and Answers', 'Referrer URLs'] } else { let scores_only if (wgt.guest_access) { @@ -15,7 +15,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 URLs'] if ( (wgt.widget.meta_data.playdata_exporters != null ? wgt.widget.meta_data.playdata_exporters.length @@ -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() }) 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.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': 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({ diff --git a/src/js/materia/materia.score.js b/src/js/materia/materia.score.js index 2cfd46f6..d44f0e55 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 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 @@ -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 non-scorable widgets. + // @param questionID the ID of the question being answered + 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) @@ -44,6 +51,7 @@ Namespace('Materia').Score = (() => { submitInteractionForScoring, submitFinalScoreFromClient, submitQuestionForScoring, + submitScoreForParticipation, addGlobalScoreFeedback, addScoreData } diff --git a/src/js/materia/materia.score.test.js b/src/js/materia/materia.score.test.js index b8738a84..a83cd416 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.submitScoreForParticipation).toBeDefined() expect(Score.addGlobalScoreFeedback).toBeDefined() expect(Score.addScoreData).toBeDefined() }) @@ -27,6 +28,11 @@ describe('Materia.Score', () => { expect(mockAddLog).toHaveBeenLastCalledWith(1008, '0', 'my message') }) + it('submitScoreForParticipation calls addLog', () => { + Score.submitScoreForParticipation() + expect(mockAddLog).toHaveBeenLastCalledWith(1006, -1, 'Participation', 100) + }) + it('submitQuestionForScoring calls addLog', () => { Score.submitQuestionForScoring(6, 'answer', 'optional value') expect(mockAddLog).toHaveBeenLastCalledWith(1004, 6, 'answer', 'optional value') 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"