From: soufiane Date: Fri, 13 Oct 2023 15:33:17 +0000 (+0200) Subject: wait #6409 @2:30 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=25c4467d048419bb0ca2088edb580aa9c87fb584;p=fluidbook-toolbox-quiz.git wait #6409 @2:30 --- diff --git a/js/quiz.draganddrop.js b/js/quiz.draganddrop.js index f0cd316..c693bdb 100644 --- a/js/quiz.draganddrop.js +++ b/js/quiz.draganddrop.js @@ -44,11 +44,13 @@ QuizDragAndDrop.prototype = { this.initQuestion(); }, - sendCurrentAnswerToArea: function (area) { + sendCurrentAnswerToArea: function (area, index) { if (this.animating === true) { return; } - this.quiz.screens.currentQuestionAnswers.push(area === 'zone-1' ? 1 : 2); + //this.quiz.screens.currentQuestionAnswers.push(area === 'zone-1' ? 1 : 2); + console.log("index",index) + this.quiz.screens.currentQuestionAnswers.splice(index, 0, area === 'zone-1' ? 1 : 2) this.animating = true; const $this = this; @@ -71,7 +73,6 @@ QuizDragAndDrop.prototype = { position: 'absolute', } if (this.quiz.resize.isMobile()) { - rules = { scale: 0.8, duration: .3, autoAlpha: 0, } @@ -149,7 +150,7 @@ QuizDragAndDrop.prototype = { // let zone = $this.getZoneOverlap(this.target) if (zone) { - $this.sendCurrentAnswerToArea(zone); + $this.sendCurrentAnswerToArea(zone, $(this.target).data("id")); } }, onRelease: function () { @@ -280,7 +281,7 @@ QuizDragAndDrop.prototype = { this.createDraggable(this) let tl = gsap.timeline() this.quiz.animations.animateDragAndDropCarrousel(tl) - }, + } } export default QuizDragAndDrop; diff --git a/views/screens/question_draganddrop.blade.php b/views/screens/question_draganddrop.blade.php index 5562b56..cc73406 100644 --- a/views/screens/question_draganddrop.blade.php +++ b/views/screens/question_draganddrop.blade.php @@ -8,10 +8,14 @@
@include('screens.arrow',['side'=>'left','action'=>'move-card'])