1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\PluginBundle\XApi\ToolExperience\Statement; |
8
|
|
|
|
9
|
|
|
use Chamilo\CourseBundle\Entity\CLp; |
10
|
|
|
use Chamilo\CourseBundle\Entity\CLp as CLpEntity; |
11
|
|
|
use Chamilo\CourseBundle\Entity\CLpView; |
12
|
|
|
use Chamilo\CourseBundle\Entity\CLpView as CLpViewEntity; |
13
|
|
|
use Chamilo\PluginBundle\XApi\ToolExperience\Activity\LearningPath as LearningPathActivity; |
14
|
|
|
use Chamilo\PluginBundle\XApi\ToolExperience\Actor\User as UserActor; |
15
|
|
|
use Chamilo\PluginBundle\XApi\ToolExperience\Verb\Completed; |
16
|
|
|
use Xabbuh\XApi\Model\Result; |
17
|
|
|
use Xabbuh\XApi\Model\Score; |
18
|
|
|
use Xabbuh\XApi\Model\Statement; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Class LearningPathCompleted. |
22
|
|
|
*/ |
23
|
|
|
class LearningPathCompleted extends BaseStatement |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* @var CLpView |
27
|
|
|
*/ |
28
|
|
|
private $lpView; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var CLp |
32
|
|
|
*/ |
33
|
|
|
private $lp; |
34
|
|
|
|
35
|
|
|
public function __construct(CLpViewEntity $lpView, CLpEntity $lp) |
36
|
|
|
{ |
37
|
|
|
$this->lpView = $lpView; |
38
|
|
|
$this->lp = $lp; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function generate(): Statement |
42
|
|
|
{ |
43
|
|
|
$user = api_get_user_entity($this->lpView->getUserId()); |
|
|
|
|
44
|
|
|
$userActor = new UserActor($user); |
45
|
|
|
$completedVerb = new Completed(); |
46
|
|
|
$lpActivity = new LearningPathActivity($this->lp); |
47
|
|
|
|
48
|
|
|
return new Statement( |
49
|
|
|
$this->generateStatementId('learning-path'), |
50
|
|
|
$userActor->generate(), |
51
|
|
|
$completedVerb->generate(), |
52
|
|
|
$lpActivity->generate(), |
53
|
|
|
new Result( |
54
|
|
|
new Score(1, 100, 0, 100), |
55
|
|
|
null, |
56
|
|
|
true |
57
|
|
|
), |
58
|
|
|
null, |
59
|
|
|
api_get_utc_datetime(null, false, true), |
60
|
|
|
null, |
61
|
|
|
$this->generateContext() |
62
|
|
|
); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.