diff --git a/app/Http/Controllers/StudentController.php b/app/Http/Controllers/StudentController.php index 7e436b54..081876b7 100644 --- a/app/Http/Controllers/StudentController.php +++ b/app/Http/Controllers/StudentController.php @@ -63,7 +63,7 @@ class StudentController extends Controller $system = app('system_settings'); $fields = $system?->fields ?? []; $showCourseCertificate = $fields['show_course_certificate'] ?? true; - $showCourseMarksheet = $fields['show_course_marksheet'] ?? true; + $showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate; if ($tab === 'certificate' && !$showCourseCertificate && !$showCourseMarksheet) { return redirect()->route('student.course.show', ['id' => $id, 'tab' => 'modules']); diff --git a/app/Services/StudentService.php b/app/Services/StudentService.php index cb84dc00..1fb26f7e 100644 --- a/app/Services/StudentService.php +++ b/app/Services/StudentService.php @@ -188,7 +188,7 @@ class StudentService extends MediaService $system = app('system_settings'); $fields = $system?->fields ?? []; $showCourseCertificate = $fields['show_course_certificate'] ?? true; - $showCourseMarksheet = $fields['show_course_marksheet'] ?? true; + $showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate; return [ 'modules' => $tab === 'modules' ? $this->getCourseModules($course_id) : null, diff --git a/resources/js/pages/course-player/partials/content-list.tsx b/resources/js/pages/course-player/partials/content-list.tsx index 33779902..8d20d966 100644 --- a/resources/js/pages/course-player/partials/content-list.tsx +++ b/resources/js/pages/course-player/partials/content-list.tsx @@ -30,6 +30,9 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps) const { course, zoomConfig, section, watchHistory, translate, direction, system } = props; const { button, common, frontend } = translate; const showCourseCertificate = system?.fields?.show_course_certificate ?? true; + const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate; + const showCertificateTab = showCourseCertificate || showCourseMarksheet; + const certificateLabel = showCourseCertificate ? frontend.course_certificate : button.marksheet || 'Notenblatt'; // Get live classes from course data const liveClasses = course.live_classes || []; @@ -116,11 +119,11 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps) @@ -131,7 +134,7 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps) Kurs abschließen ) : ( - )} diff --git a/resources/js/pages/courses/partials/instructor.tsx b/resources/js/pages/courses/partials/instructor.tsx index b94aa201..d7caf900 100644 --- a/resources/js/pages/courses/partials/instructor.tsx +++ b/resources/js/pages/courses/partials/instructor.tsx @@ -59,7 +59,7 @@ const Instructor = ({ course }: { course: Course }) => { ); diff --git a/resources/js/pages/student/course.tsx b/resources/js/pages/student/course.tsx index 2749d413..e4e5e6d7 100644 --- a/resources/js/pages/student/course.tsx +++ b/resources/js/pages/student/course.tsx @@ -18,8 +18,9 @@ const Course = (props: StudentCourseProps) => { const { tab, course, watchHistory, completion, system } = props; const showCourseCertificate = system?.fields?.show_course_certificate ?? true; - const showCourseMarksheet = system?.fields?.show_course_marksheet ?? true; + const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate; const showCertificateTab = showCourseCertificate || showCourseMarksheet; + const certificateTabLabel = showCourseCertificate ? 'Zertifikat' : 'Notenblatt'; const tabs = [ { @@ -46,7 +47,7 @@ const Course = (props: StudentCourseProps) => { ? [ { value: 'certificate', - label: 'Zertifikat', + label: certificateTabLabel, }, ] : []), diff --git a/resources/js/pages/student/tabs-content/course-certificate.tsx b/resources/js/pages/student/tabs-content/course-certificate.tsx index 125f8c4e..23536529 100644 --- a/resources/js/pages/student/tabs-content/course-certificate.tsx +++ b/resources/js/pages/student/tabs-content/course-certificate.tsx @@ -13,7 +13,7 @@ const CourseCertificate = () => { const { course, watchHistory, completion, certificateTemplate, marksheetTemplate, studentMarks, auth, system } = props; const showCourseCertificate = system?.fields?.show_course_certificate ?? true; - const showCourseMarksheet = system?.fields?.show_course_marksheet ?? true; + const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate; if (!showCourseCertificate && !showCourseMarksheet) { return (