Merge pull request #1105 from pateljannat/issues-48

fix: show only courses with evaluator for batch evaluation
This commit is contained in:
Jannat Patel
2024-11-08 15:04:42 +05:30
committed by GitHub
4 changed files with 10 additions and 6 deletions

View File

@@ -154,11 +154,13 @@ function submitEvaluation(close) {
const getCourses = () => { const getCourses = () => {
let courses = [] let courses = []
for (const course of props.courses) { for (const course of props.courses) {
if (course.evaluator) {
courses.push({ courses.push({
label: course.title, label: course.title,
value: course.course, value: course.course,
}) })
} }
}
return courses return courses
} }

View File

@@ -83,6 +83,7 @@
v-model="instructors" v-model="instructors"
doctype="User" doctype="User"
:label="__('Instructors')" :label="__('Instructors')"
:filters="{ ignore_user_type: 1 }"
/> />
<div class="mb-4"> <div class="mb-4">
<FormControl <FormControl

View File

@@ -152,6 +152,7 @@
v-model="instructors" v-model="instructors"
doctype="User" doctype="User"
:label="__('Instructors')" :label="__('Instructors')"
:filters="{ ignore_user_type: 1 }"
:required="true" :required="true"
/> />
</div> </div>

View File

@@ -1103,7 +1103,7 @@ def get_categorized_courses(courses):
categories = [live, enrolled, created] categories = [live, enrolled, created]
for category in categories: for category in categories:
category.sort(key=lambda x: x.enrollments, reverse=True) category.sort(key=lambda x: cint(x.enrollments), reverse=True)
live.sort(key=lambda x: x.featured, reverse=True) live.sort(key=lambda x: x.featured, reverse=True)
@@ -1265,7 +1265,7 @@ def get_batch_details(batch):
batch_details.instructors = get_instructors(batch) batch_details.instructors = get_instructors(batch)
batch_details.courses = frappe.get_all( batch_details.courses = frappe.get_all(
"Batch Course", filters={"parent": batch}, fields=["course", "title"] "Batch Course", filters={"parent": batch}, fields=["course", "title", "evaluator"]
) )
batch_details.students = frappe.get_all( batch_details.students = frappe.get_all(
"Batch Student", {"parent": batch}, pluck="student" "Batch Student", {"parent": batch}, pluck="student"