Passed
Pull Request — 1.11.x (#4900)
by Angel Fernando Quiroz
09:35
created

DetailControllerTrait::generateHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 12
rs 9.9666
cc 1
nc 1
nop 3
1
<?php
2
3
/* For license terms, see /license.txt */
4
5
namespace Chamilo\PluginBundle\ExerciseFocused\Traits;
6
7
use Chamilo\CoreBundle\Entity\TrackEExercises;
8
use Chamilo\UserBundle\Entity\User;
9
use Display;
10
use Exercise;
11
12
trait DetailControllerTrait
13
{
14
    private function generateHeader(Exercise $objExercise, User $student, TrackEExercises $trackExe): string
15
    {
16
        $startDate = api_get_local_time($trackExe->getStartDate(), null, null, true, true, true);
17
        $endDate = api_get_local_time($trackExe->getExeDate(), null, null, true, true, true);
18
19
        return Display::page_subheader2($objExercise->selectTitle())
20
            .Display::tag('p', $student->getCompleteNameWithUsername(), ['class' => 'lead'])
21
            .Display::tag(
22
                'p',
23
                sprintf(get_lang('QuizRemindStartDate'), $startDate)
24
                .sprintf(get_lang('QuizRemindEndDate'), $endDate)
25
                .sprintf(get_lang('QuizRemindDuration'), api_format_time($trackExe->getExeDuration()))
26
            );
27
    }
28
}
29