From 6fb49b17e6d220c77cf887a04ea4208c3a5e4189 Mon Sep 17 00:00:00 2001 From: David Joy Date: Mon, 13 Apr 2020 16:49:15 -0400 Subject: [PATCH 1/2] fix: Properly limit 'feedback.opened' events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only send ‘feedback.opened’ if there are elements in feedback array. See https://openedx.atlassian.net/browse/TNL-7184 for complete details and more background. Long story short, if a drag and drop item doesn't have a success or error feedback message, the backend sends an empty array of feedback, which the frontend wasn't consuming properly. This PR allows the frontend to interpret an empty array as not worthy of sending a feedback.opened event. --- drag_and_drop_v2/public/js/drag_and_drop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drag_and_drop_v2/public/js/drag_and_drop.js b/drag_and_drop_v2/public/js/drag_and_drop.js index 6e72ac176..af43a146f 100644 --- a/drag_and_drop_v2/public/js/drag_and_drop.js +++ b/drag_and_drop_v2/public/js/drag_and_drop.js @@ -1139,7 +1139,7 @@ function DragAndDropBlock(runtime, element, configuration) { delete state.closing; } // Has feedback been set? - if (state.feedback) { + if (state.feedback && state.feedback.length > 0) { var data = { event_type: 'edx.drag_and_drop_v2.feedback.opened', content: concatenateFeedback(state.feedback), From f79b2115187bccc18914d6b9e682dd8a0ae1da9e Mon Sep 17 00:00:00 2001 From: David Joy Date: Tue, 14 Apr 2020 13:33:48 -0400 Subject: [PATCH 2/2] Bumping version to 2.2.10 and backfilling Changelog.md --- Changelog.md | 35 +++++++++++++++++++++++++++++++++-- setup.py | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index f16c0b368..78cbc1b55 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,37 @@ Drag and Drop XBlock changelog ============================== +Version 2.2.10 (2020-04-14) +--------------------------- + +* Fix bug where 'edx.drag_and_drop_v2.feedback.opened' event was sent to publish_event endpoint excessively on mouse move. (PR #238) + +Version 2.2.9 (2020-04-03) +-------------------------- + +* Updated fragment import to remove deprecation warning which was causing extra logs in Splunk etc. + +Version 2.2.8 (2020-01-13) +-------------------------- + +* Updated code to render custom zone title as HTML + +Version 2.2.7 (????-??-??) +------------------- + +* NOTE: This version was skipped / is not documented. + +Version 2.2.6 (2019-10-08) +-------------------------- + +* Python3 compatible. + +Version 2.2.5 (2019-10-04) +-------------------------- + +* This repository is now python3 compatible. +* Update the xblock-sdk hash which is python3 compatible also. + Version 2.2.4 (2019-07-30) --------------------------- @@ -56,7 +87,7 @@ Version 2.1.5 (2017-11-06) Version 2.1.4 (2017-11-06) --------------------------- -* Make XBlock always emit `progress` event explicitly when it is marked as complete. +* Make XBlock always emit `progress` event explicitly when it is marked as complete. Version 2.1.3 (2017-10-05) --------------------------- @@ -92,7 +123,7 @@ Version 2.0.12 (2016-11-08) * [SOL-2094][sol-2094] Fixed problem preventing DnDv2 blocks from being scored or graded. * Highest grade achieved is now displayed in feedback area * Renamed "Maximum score" field to "Problem Weight" to be in line with CAPA problems and avoid confusion. - + [sol-2030]: https://openedx.atlassian.net/browse/SOL-2030 [sol-2094]: https://openedx.atlassian.net/browse/SOL-2094 diff --git a/setup.py b/setup.py index f11dc52ea..f37dc8d09 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def package_data(pkg, root_list): setup( name='xblock-drag-and-drop-v2', - version='2.2.9', + version='2.2.10', description='XBlock - Drag-and-Drop v2', packages=['drag_and_drop_v2'], install_requires=[