bugfix
All checks were successful
Build & Push Docker Image / docker (push) Successful in 5m53s

This commit is contained in:
Ahmed Darrazi 2025-12-20 23:59:00 +01:00
parent 2055484a87
commit c7cc8d17b1
6 changed files with 13 additions and 9 deletions

View File

@ -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']);

View File

@ -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,

View File

@ -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)
<Link
href={route('student.course.show', {
id: course.id,
tab: showCourseCertificate ? 'certificate' : 'modules',
tab: showCertificateTab ? 'certificate' : 'modules',
})}
>
<Button className="w-full" variant="secondary" size="lg" disabled={courseCompletion.percentage !== '100.00'}>
{showCourseCertificate ? frontend.course_certificate : 'Module'}
{showCertificateTab ? certificateLabel : 'Module'}
</Button>
</Link>
</div>

View File

@ -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,
},
]
: []),

View File

@ -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 (