This commit is contained in:
parent
2055484a87
commit
c7cc8d17b1
@ -63,7 +63,7 @@ class StudentController extends Controller
|
|||||||
$system = app('system_settings');
|
$system = app('system_settings');
|
||||||
$fields = $system?->fields ?? [];
|
$fields = $system?->fields ?? [];
|
||||||
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
||||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? true;
|
$showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate;
|
||||||
|
|
||||||
if ($tab === 'certificate' && !$showCourseCertificate && !$showCourseMarksheet) {
|
if ($tab === 'certificate' && !$showCourseCertificate && !$showCourseMarksheet) {
|
||||||
return redirect()->route('student.course.show', ['id' => $id, 'tab' => 'modules']);
|
return redirect()->route('student.course.show', ['id' => $id, 'tab' => 'modules']);
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class StudentService extends MediaService
|
|||||||
$system = app('system_settings');
|
$system = app('system_settings');
|
||||||
$fields = $system?->fields ?? [];
|
$fields = $system?->fields ?? [];
|
||||||
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
||||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? true;
|
$showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'modules' => $tab === 'modules' ? $this->getCourseModules($course_id) : null,
|
'modules' => $tab === 'modules' ? $this->getCourseModules($course_id) : null,
|
||||||
|
|||||||
@ -30,6 +30,9 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
|
|||||||
const { course, zoomConfig, section, watchHistory, translate, direction, system } = props;
|
const { course, zoomConfig, section, watchHistory, translate, direction, system } = props;
|
||||||
const { button, common, frontend } = translate;
|
const { button, common, frontend } = translate;
|
||||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
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
|
// Get live classes from course data
|
||||||
const liveClasses = course.live_classes || [];
|
const liveClasses = course.live_classes || [];
|
||||||
@ -116,11 +119,11 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
|
|||||||
<Link
|
<Link
|
||||||
href={route('student.course.show', {
|
href={route('student.course.show', {
|
||||||
id: course.id,
|
id: course.id,
|
||||||
tab: showCourseCertificate ? 'certificate' : 'modules',
|
tab: showCertificateTab ? 'certificate' : 'modules',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Button className="w-full" variant="secondary" size="lg" disabled={courseCompletion.percentage !== '100.00'}>
|
<Button className="w-full" variant="secondary" size="lg" disabled={courseCompletion.percentage !== '100.00'}>
|
||||||
{showCourseCertificate ? frontend.course_certificate : 'Module'}
|
{showCertificateTab ? certificateLabel : 'Module'}
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,8 +18,9 @@ const Course = (props: StudentCourseProps) => {
|
|||||||
const { tab, course, watchHistory, completion, system } = props;
|
const { tab, course, watchHistory, completion, system } = props;
|
||||||
|
|
||||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
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 showCertificateTab = showCourseCertificate || showCourseMarksheet;
|
||||||
|
const certificateTabLabel = showCourseCertificate ? 'Zertifikat' : 'Notenblatt';
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
@ -46,7 +47,7 @@ const Course = (props: StudentCourseProps) => {
|
|||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
value: 'certificate',
|
value: 'certificate',
|
||||||
label: 'Zertifikat',
|
label: certificateTabLabel,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
|||||||
@ -13,7 +13,7 @@ const CourseCertificate = () => {
|
|||||||
const { course, watchHistory, completion, certificateTemplate, marksheetTemplate, studentMarks, auth, system } = props;
|
const { course, watchHistory, completion, certificateTemplate, marksheetTemplate, studentMarks, auth, system } = props;
|
||||||
|
|
||||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
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) {
|
if (!showCourseCertificate && !showCourseMarksheet) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user