Skip to content

Commit

Permalink
Merge pull request #1105 from pateljannat/issues-48
Browse files Browse the repository at this point in the history
fix: show only courses with evaluator for batch evaluation
  • Loading branch information
pateljannat authored Nov 8, 2024
2 parents 3ea52a4 + 4e61d56 commit c5f091f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions frontend/src/components/Modals/EvaluationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ function submitEvaluation(close) {
const getCourses = () => {
let courses = []
for (const course of props.courses) {
courses.push({
label: course.title,
value: course.course,
})
if (course.evaluator) {
courses.push({
label: course.title,
value: course.course,
})
}
}
return courses
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/BatchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
v-model="instructors"
doctype="User"
:label="__('Instructors')"
:filters="{ ignore_user_type: 1 }"
/>
<div class="mb-4">
<FormControl
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/CourseForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
v-model="instructors"
doctype="User"
:label="__('Instructors')"
:filters="{ ignore_user_type: 1 }"
:required="true"
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions lms/lms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ def get_categorized_courses(courses):

categories = [live, enrolled, created]
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)

Expand Down Expand Up @@ -1265,7 +1265,7 @@ def get_batch_details(batch):
batch_details.instructors = get_instructors(batch)

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 Student", {"parent": batch}, pluck="student"
Expand Down

0 comments on commit c5f091f

Please sign in to comment.