update: bug on assessment when type on essay not in on the database
This commit is contained in:
parent
b7b1981ec5
commit
c0c2f0552b
|
|
@ -356,7 +356,7 @@
|
||||||
<textarea name="question_{{ $question->id }}"
|
<textarea name="question_{{ $question->id }}"
|
||||||
class="w-100 h-24 p-3 border rounded-lg focus:ring focus:ring-blue-200"
|
class="w-100 h-24 p-3 border rounded-lg focus:ring focus:ring-blue-200"
|
||||||
placeholder="Masukkan jawaban Anda di sini..."
|
placeholder="Masukkan jawaban Anda di sini..."
|
||||||
oninput="saveAnswer('{{ $question->id }}', this.value); updateQuestionUI('essay', '{{ $question->id }}');">{{ $savedAnswer ? $savedAnswer->answer_text : '' }}</textarea>
|
oninput="saveEssayAnswerDebounced('{{ $question->id }}', this.value); updateQuestionUI('essay', '{{ $question->id }}');">{{ $savedAnswer ? $savedAnswer->answer_text : '' }}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
@ -538,6 +538,19 @@ function updateQuestionUI(type, questionId) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function debounce(func, delay) {
|
||||||
|
let timeout;
|
||||||
|
return function(...args) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = setTimeout(() => func.apply(this, args), delay);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const saveEssayAnswerDebounced = debounce(function(questionId, value) {
|
||||||
|
saveAnswer(questionId, value);
|
||||||
|
}, 600);
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- JavaScript untuk mengubah konten tab -->
|
<!-- JavaScript untuk mengubah konten tab -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user