From 41094b8e7ab3d5fd50713b828868caeb56ece234 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 9 Nov 2023 14:27:13 +0100 Subject: [PATCH] wait #6459 @0:30 --- js/quiz.draganddrop.js | 5 ++--- views/screens/question_draganddrop.blade.php | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/js/quiz.draganddrop.js b/js/quiz.draganddrop.js index ac5fd8b..41551f6 100644 --- a/js/quiz.draganddrop.js +++ b/js/quiz.draganddrop.js @@ -24,12 +24,12 @@ QuizDragAndDrop.prototype = { zone = 'zone-2'; } - $this.sendCurrentAnswerToArea(zone); + let index = $this.activeScreen.find(".list-item").eq(0).data('id') + $this.sendCurrentAnswerToArea(zone,index); }); }, start: function () { - this.activeScreen = this.quiz.screens.getActiveScreen() this.list = this.activeScreen.find(".list") this.listHtml = this.list.html() @@ -49,7 +49,6 @@ QuizDragAndDrop.prototype = { return; } //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; diff --git a/views/screens/question_draganddrop.blade.php b/views/screens/question_draganddrop.blade.php index e1125df..b5da27e 100644 --- a/views/screens/question_draganddrop.blade.php +++ b/views/screens/question_draganddrop.blade.php @@ -11,10 +11,10 @@ @php $keys = array_keys($question['answers']); @endphp - @foreach($keys as $index => $key) -
  • -

    {{$question['answers'][$key]['answer']}}

    -

    {{$question['answers'][$key]['answer_text']}}

    + @foreach($question['answers'] as $index => $c) +
  • +

    {{$c['answer']}}

    +

    {{$c['answer_text']}}

  • @endforeach
  • -- 2.39.5