});
},
-
// Load the animation "name" in container
load: function (name, container, replace, loop = false) {
let json = this.quiz.data.animations[name];
},
ease: "power1.inOut",
stagger: .15,
- onComplete: function(index, target) {
+ onComplete: function() {
$(".active-screen .list-item").addClass("complete")
}
}, .7)
},
start: function() {
- const $this = this;
-
this.activeScreen = this.quiz.screens.getActiveScreen()
this.list = this.activeScreen.find(".list")
this.listHtml = this.list.html()
target.addClass("isValidated")
},
onComplete: function () {
- let html = target.html(),
+ let text = target.text(),
id = "answer-"+target.data("id")
- $(zone).find(".slot:not(.active)").eq(0).addClass("active").html(html).attr('data-order',target.data("id"))
+ $(zone).find(".slot:not(.active)").eq(0).addClass("active").append("<span>"+text+"</span>").attr('data-order',target.data("id"))
$this.saveAnswer(zone,id)
target.remove()
}
duration: 0
}, "+=0.3")
}
-
},
onRelease: function() {
//
})
}
+ //
+ if($this.activeScreen.find(".list-item:not(.isDragging)").length === 0) {
+ $this.toggleScreen(0,"none")
+ }
+
$(this.target).removeClass("isDragging")
// reset list rotation
$(".zone-1,.zone-2").removeClass("active")
},
+ toggleScreen: function(opacity,pointer) {
+ gsap.to(".active-screen .screen", {
+ opacity: opacity,
+ pointerEvents: pointer
+ })
+ },
+
getZoneOverlap: function(offsetLeft, offsetRight) {
let zone = false,
zone1 = ".zone-1",
saveAnswer: function(zone,id) {
$(zone).find("input[id="+id+"]").prop("checked", true)
-
- console.log($("input:checked"))
+ this.quiz.screens.updateUserAnswers();
}
}
this.getCurrentForm().find("input").prop("checked", false)
if(!only) {
if(this.quiz.question.isDragAndDrop()) {
+ this.quiz.draganddrop.toggleScreen(1,"initial")
this.quiz.draganddrop.retreiveAnswer()
}
}