@@ -82,14 +82,18 @@ DragNDrop.prototype.createNewElements = function () {
8282 $ ( this . containerDiv ) . text ( this . question ) ;
8383 this . containerDiv . appendChild ( document . createElement ( "br" ) ) ;
8484
85+ this . dragDropWrapDiv = document . createElement ( "div" ) ; // Holds the draggables/dropzones, prevents feedback from bleeding in
86+ $ ( this . dragDropWrapDiv ) . css ( "display" , "block" ) ;
87+ this . containerDiv . appendChild ( this . dragDropWrapDiv ) ;
88+
8589 this . draggableDiv = document . createElement ( "div" ) ;
8690 $ ( this . draggableDiv ) . addClass ( "draggable dragzone" ) ;
8791 this . addDragDivListeners ( ) ;
8892
8993 this . dropZoneDiv = document . createElement ( "div" ) ;
9094 $ ( this . dropZoneDiv ) . addClass ( "draggable" ) ;
91- this . containerDiv . appendChild ( this . draggableDiv ) ;
92- this . containerDiv . appendChild ( this . dropZoneDiv ) ;
95+ this . dragDropWrapDiv . appendChild ( this . draggableDiv ) ;
96+ this . dragDropWrapDiv . appendChild ( this . dropZoneDiv ) ;
9397
9498 this . createButtons ( ) ;
9599 this . checkLocalStorage ( ) ;
@@ -100,8 +104,12 @@ DragNDrop.prototype.createNewElements = function () {
100104 if ( ! this . hasStoredDropzones ) {
101105 this . minheight = $ ( this . draggableDiv ) . height ( ) ;
102106 }
103-
104107 this . draggableDiv . style . minHeight = this . minheight . toString ( ) + "px" ;
108+ if ( $ ( this . dropZoneDiv ) . height ( ) > this . minheight ) {
109+ this . dragDropWrapDiv . style . minHeight = $ ( this . dropZoneDiv ) . height ( ) . toString ( ) + "px" ;
110+ } else {
111+ this . dragDropWrapDiv . style . minHeight = this . minheight . toString ( ) + "px" ;
112+ }
105113} ;
106114
107115DragNDrop . prototype . addDragDivListeners = function ( ) {
@@ -368,7 +376,8 @@ DragNDrop.prototype.checkLocalStorage = function () {
368376=================================*/
369377$ ( document ) . ready ( function ( ) {
370378 $ ( "[data-component=dragndrop]" ) . each ( function ( index ) {
371- ddList [ this . id ] = new DragNDrop ( { "orig" : this } ) ;
379+ if ( $ ( this . parentNode ) . data ( "component" ) !== "timedAssessment" ) { // If this element exists within a timed component, don't render it here
380+ ddList [ this . id ] = new DragNDrop ( { "orig" : this } ) ;
381+ }
372382 } ) ;
373-
374383} ) ;
0 commit comments