Compare commits

..

3 Commits

Author SHA1 Message Date
Jannat Patel
699c821edd fix: spacing and widths 2024-08-05 11:12:34 +05:30
Jannat Patel
6820dfc820 fix: make question attachments public 2024-08-01 13:02:20 +05:30
Jannat Patel
e0855a2c1b fix: quiz question population issue 2024-07-31 22:30:29 +05:30
6 changed files with 67 additions and 63 deletions

View File

@@ -3,7 +3,7 @@
class="flex flex-col shadow hover:bg-gray-100 rounded-md p-4 h-full" class="flex flex-col shadow hover:bg-gray-100 rounded-md p-4 h-full"
style="min-height: 150px" style="min-height: 150px"
> >
<div class="text-xl font-semibold mb-2"> <div class="text-lg leading-5 font-semibold mb-2">
{{ batch.title }} {{ batch.title }}
</div> </div>
<Badge <Badge
@@ -22,18 +22,17 @@
> >
{{ __('Sold Out') }} {{ __('Sold Out') }}
</Badge> </Badge>
<div class="short-introduction"> <div class="short-introduction text-sm text-gray-700">
{{ batch.description }} {{ batch.description }}
</div> </div>
<div class="flex flex-col space-y-2 mt-auto"> <div v-if="batch.amount" class="font-semibold mb-4">
<div v-if="batch.amount" class="font-semibold text-lg">
{{ batch.price }} {{ batch.price }}
</div> </div>
<div class="flex flex-col space-y-2 mt-auto">
<DateRange <DateRange
:startDate="batch.start_date" :startDate="batch.start_date"
:endDate="batch.end_date" :endDate="batch.end_date"
class="text-sm text-gray-700 mb-3" class="text-sm text-gray-700"
/> />
<div class="flex items-center text-sm text-gray-700"> <div class="flex items-center text-sm text-gray-700">
<Clock class="h-4 w-4 stroke-1.5 mr-2 text-gray-700" /> <Clock class="h-4 w-4 stroke-1.5 mr-2 text-gray-700" />
@@ -50,7 +49,11 @@
{{ batch.timezone }} {{ batch.timezone }}
</span> </span>
</div> </div>
<div v-if="batch.instructors?.length" class="flex avatar-group overlap"> </div>
<div
v-if="batch.instructors?.length"
class="flex avatar-group overlap mt-4"
>
<div <div
class="h-6 mr-1" class="h-6 mr-1"
:class="{ 'avatar-group overlap': batch.instructors.length > 1 }" :class="{ 'avatar-group overlap': batch.instructors.length > 1 }"
@@ -63,7 +66,6 @@
<CourseInstructors :instructors="batch.instructors" /> <CourseInstructors :instructors="batch.instructors" />
</div> </div>
</div> </div>
</div>
</template> </template>
<script setup> <script setup>
import { Badge } from 'frappe-ui' import { Badge } from 'frappe-ui'
@@ -88,7 +90,7 @@ const props = defineProps({
text-overflow: ellipsis; text-overflow: ellipsis;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
margin: 0.25rem 0 1.25rem; margin: 0.25rem 0 1rem;
line-height: 1.5; line-height: 1.5;
} }

View File

@@ -72,7 +72,7 @@
{{ course.title }} {{ course.title }}
</div> </div>
<div class="short-introduction"> <div class="short-introduction text-gray-700 text-sm">
{{ course.short_introduction }} {{ course.short_introduction }}
</div> </div>

View File

@@ -269,18 +269,20 @@ const quiz = createResource({
cache: ['quiz', props.quizName], cache: ['quiz', props.quizName],
auto: true, auto: true,
onSuccess(data) { onSuccess(data) {
shuffleQuiz() populateQuestions()
}, },
}) })
const shuffleQuiz = () => { const populateQuestions = () => {
let data = quiz.data let data = quiz.data
if (data.shuffle_questions) { if (data.shuffle_questions) {
questions = shuffleArray(data.questions) questions = shuffleArray(data.questions)
}
if (data.limit_questions_to) { if (data.limit_questions_to) {
questions = questions.slice(0, data.limit_questions_to) questions = questions.slice(0, data.limit_questions_to)
} }
} else {
questions = data.questions
}
} }
const shuffleArray = (array) => { const shuffleArray = (array) => {
@@ -322,7 +324,7 @@ const attempts = createResource({
watch( watch(
() => quiz.data, () => quiz.data,
() => { () => {
if (quiz.data) { if (quiz.data && quiz.data.max_attempts) {
attempts.reload() attempts.reload()
resetQuiz() resetQuiz()
} }
@@ -476,7 +478,7 @@ const submitQuiz = () => {
const createSubmission = () => { const createSubmission = () => {
quizSubmission.reload().then(() => { quizSubmission.reload().then(() => {
attempts.reload() if (quiz.data && quiz.data.max_attempts) attempts.reload()
}) })
} }
@@ -485,7 +487,7 @@ const resetQuiz = () => {
selectedOptions.splice(0, selectedOptions.length, ...[0, 0, 0, 0]) selectedOptions.splice(0, selectedOptions.length, ...[0, 0, 0, 0])
showAnswers.length = 0 showAnswers.length = 0
quizSubmission.reset() quizSubmission.reset()
shuffleQuiz() populateQuestions()
} }
const getSubmissionColumns = () => { const getSubmissionColumns = () => {

View File

@@ -50,9 +50,9 @@
</Button> </Button>
</div> </div>
</header> </header>
<div v-if="job.data" class="w-3/4 mx-auto"> <div v-if="job.data" class="max-w-3xl mx-auto">
<div class="p-4"> <div class="p-4">
<div class="flex mb-4"> <div class="flex mb-10">
<img <img
:src="job.data.company_logo" :src="job.data.company_logo"
class="w-16 h-16 rounded-lg object-contain mr-4" class="w-16 h-16 rounded-lg object-contain mr-4"
@@ -62,8 +62,9 @@
<div class="text-2xl font-semibold mb-4"> <div class="text-2xl font-semibold mb-4">
{{ job.data.job_title }} {{ job.data.job_title }}
</div> </div>
<div class="grid grid-cols-3 gap-8"> <div
<div class="grid grid-cols-1 gap-2"> class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-10 gap-y-2 md:gap-y-4"
>
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<Building2 class="h-4 w-4 stroke-1.5" /> <Building2 class="h-4 w-4 stroke-1.5" />
<span>{{ job.data.company_name }}</span> <span>{{ job.data.company_name }}</span>
@@ -72,20 +73,16 @@
<MapPin class="h-4 w-4 stroke-1.5" /> <MapPin class="h-4 w-4 stroke-1.5" />
<span>{{ job.data.location }}</span> <span>{{ job.data.location }}</span>
</div> </div>
</div>
<div class="grid grid-cols-1 gap-2">
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<ClipboardType class="h-4 w-4 stroke-1.5" /> <ClipboardType class="h-4 w-4 stroke-1.5" />
<span>{{ job.data.type }}</span> <span>{{ job.data.type }}</span>
</div> </div>
<div class="flex items-center space-x-2"> <div class="flex items-center space-x-2">
<CalendarDays class="h-4 w-4 stroke-1.5" /> <CalendarDays class="h-4 w-4 stroke-1.5" />
<span>{{ <span>
dayjs(job.data.creation).format('DD MMM YYYY') {{ dayjs(job.data.creation).format('DD MMM YYYY') }}
}}</span> </span>
</div> </div>
</div>
<div class="grid grid-cols-1 h-fit">
<div <div
v-if="applicationCount.data" v-if="applicationCount.data"
class="flex items-center space-x-2" class="flex items-center space-x-2"
@@ -99,7 +96,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<p <p
v-html="job.data.description" v-html="job.data.description"
class="ProseMirror prose prose-table:table-fixed prose-td:p-2 prose-th:p-2 prose-td:border prose-th:border prose-td:border-gray-300 prose-th:border-gray-300 prose-td:relative prose-th:relative prose-th:bg-gray-100 prose-sm max-w-none !whitespace-normal mt-6" class="ProseMirror prose prose-table:table-fixed prose-td:p-2 prose-th:p-2 prose-td:border prose-th:border prose-td:border-gray-300 prose-th:border-gray-300 prose-td:relative prose-th:relative prose-th:bg-gray-100 prose-sm max-w-none !whitespace-normal mt-6"

View File

@@ -176,7 +176,10 @@ update_website_context = [
] ]
jinja = { jinja = {
"methods": ["lms.lms.utils.get_signup_optin_checks"], "methods": [
"lms.lms.utils.get_signup_optin_checks",
"lms.lms.utils.get_tags",
],
"filters": [], "filters": [],
} }
## Specify the additional tabs to be included in the user profile page. ## Specify the additional tabs to be included in the user profile page.

View File

@@ -195,7 +195,8 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2024-05-24 16:12:26.331351", "make_attachments_public": 1,
"modified": "2024-08-01 13:01:55.000072",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Question", "name": "LMS Question",