diff --git a/frontend/src/views/StudyView.vue b/frontend/src/views/StudyView.vue
index 44fb6d0..6effc51 100644
--- a/frontend/src/views/StudyView.vue
+++ b/frontend/src/views/StudyView.vue
@@ -102,14 +102,22 @@
-
-
+
+
+
@@ -299,6 +307,32 @@ const selectedCategory = ref('')
const studyElements = ref
([])
const searchQuery = ref('')
+const randomizeElements = ref(false)
+const shuffledElements = ref([])
+
+function shuffleStudyElements() {
+ const arr = [...studyElements.value]
+ for (let i = arr.length - 1; i > 0; i--) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [arr[i], arr[j]] = [arr[j], arr[i]]
+ }
+ shuffledElements.value = arr
+}
+
+watch(randomizeElements, (newVal) => {
+ if (newVal) {
+ shuffleStudyElements()
+ } else {
+ shuffledElements.value = []
+ }
+})
+
+watch(studyElements, () => {
+ if (randomizeElements.value) {
+ shuffleStudyElements()
+ }
+})
+
// Load lists
const categoriesCountMap = computed(() => {
const map: Record = {}
@@ -463,9 +497,10 @@ const renderedContent = computed(() => {
// Search elements
const filteredElements = computed(() => {
- if (!searchQuery.value.trim()) return studyElements.value
+ const baseElements = randomizeElements.value ? shuffledElements.value : studyElements.value
+ if (!searchQuery.value.trim()) return baseElements
const q = searchQuery.value.toLowerCase()
- return studyElements.value.filter(se =>
+ return baseElements.filter(se =>
se.questionId.toString().includes(q) ||
se.questionText.toLowerCase().includes(q) ||
se.keyword.toLowerCase().includes(q) ||
@@ -627,7 +662,18 @@ function isSwipeException(target: HTMLElement | null): boolean {
let el = target
while (el) {
const tagName = el.tagName.toLowerCase()
- if (tagName === 'img' || tagName === 'canvas' || tagName === 'embed' || tagName === 'iframe') {
+ if (
+ tagName === 'img' ||
+ tagName === 'canvas' ||
+ tagName === 'embed' ||
+ tagName === 'iframe' ||
+ tagName === 'table' ||
+ tagName === 'thead' ||
+ tagName === 'tbody' ||
+ tagName === 'tr' ||
+ tagName === 'td' ||
+ tagName === 'th'
+ ) {
return true
}
const classes = el.classList