fix: quiz and time validation before linking to video

This commit is contained in:
Jannat Patel
2025-06-02 19:12:13 +05:30
parent 7b7484332b
commit 2c8ce133f7
5 changed files with 58 additions and 23 deletions

View File

@@ -118,10 +118,10 @@
/>
</template>
<script setup>
import { ref, onMounted, computed, watch } from 'vue'
import { ref, onMounted, computed } from 'vue'
import { Pause, Maximize, Volume2, VolumeX } from 'lucide-vue-next'
import { Button } from 'frappe-ui'
import { formatSeconds } from '@/utils'
import { formatSeconds, formatTimestamp } from '@/utils'
import Play from '@/components/Icons/Play.vue'
import QuizInVideo from '@/components/Modals/QuizInVideo.vue'
@@ -259,13 +259,6 @@ const toggleFullscreen = () => {
videoContainer.value.requestFullscreen()
}
}
const formatTimestamp = (seconds) => {
const date = new Date(seconds * 1000)
const minutes = String(date.getUTCMinutes()).padStart(2, '0')
const secs = String(date.getUTCSeconds()).padStart(2, '0')
return `${minutes}:${secs}`
}
</script>
<style scoped>