]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6459 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Thu, 9 Nov 2023 13:27:13 +0000 (14:27 +0100)
committersoufiane <soufiane@cubedesigners.com>
Thu, 9 Nov 2023 13:27:13 +0000 (14:27 +0100)
js/quiz.draganddrop.js
views/screens/question_draganddrop.blade.php

index ac5fd8b8b428e5f21c0e034331e5bbe01ba5bc07..41551f62e709234db182f2380dc466f080c0a766 100644 (file)
@@ -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;
index e1125df2e38f457c03503a63b5009f5b71e01f9a..b5da27e1249e260868834cfc650ff63622624e1e 100644 (file)
                 @php
                     $keys = array_keys($question['answers']);
                 @endphp
-                @foreach($keys as $index => $key)
-                    <li class="list-item {{ $index === 0 ? 'current' : '' }}" data-id="{{$key}}">
-                        <h4>{{$question['answers'][$key]['answer']}}</h4>
-                        <p>{{$question['answers'][$key]['answer_text']}}</p>
+                @foreach($question['answers'] as $index => $c)
+                    <li class="list-item {{ $index === 0 ? 'current' : '' }}" data-id="{{$index}}">
+                        <h4>{{$c['answer']}}</h4>
+                        <p>{{$c['answer_text']}}</p>
                     </li>
                 @endforeach
                 <li class="overlay"></li>