1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Skill/classes/class.ilPersonalSkillsGUI.php';
5
6/**
7 * @author		Björn Heyser <bheyser@databay.de>
8 * @version		$Id$
9 *
10 * @package     Modules/Test
11 */
12class ilTestPersonalSkillsGUI
13{
14    /**
15     * @var ilLanguage
16     */
17    private $lng;
18
19    private $availableSkills;
20
21    private $selectedSkillProfile;
22
23    private $reachedSkillLevels;
24
25    private $usrId;
26
27    /**
28     * @var int
29     */
30    private $testId;
31
32    /**
33     * @param ilLanguage $lng
34     * @param int        $testId
35     */
36    public function __construct(ilLanguage $lng, $testId)
37    {
38        $this->lng = $lng;
39        $this->testId = $testId;
40    }
41
42    public function getHTML()
43    {
44        $gui = new ilPersonalSkillsGUI();
45
46        $gui->setGapAnalysisActualStatusModePerObject($this->getTestId(), $this->lng->txt('tst_test_result'));
47
48        $gui->setTriggerObjectsFilter(array($this->getTestId()));
49        $gui->setHistoryView(true); // NOT IMPLEMENTED YET
50
51        // this is not required, we have no self evals in the test context,
52        // getReachedSkillLevel is a "test evaluation"
53        //$gui->setGapAnalysisSelfEvalLevels($this->getReachedSkillLevels());
54
55        $gui->setProfileId($this->getSelectedSkillProfile());
56
57        $html = $gui->getGapAnalysisHTML($this->getUsrId(), $this->getAvailableSkills());
58
59        return $html;
60    }
61
62    public function setAvailableSkills($availableSkills)
63    {
64        $this->availableSkills = $availableSkills;
65    }
66
67    public function getAvailableSkills()
68    {
69        return $this->availableSkills;
70    }
71
72    public function setSelectedSkillProfile($selectedSkillProfile)
73    {
74        $this->selectedSkillProfile = $selectedSkillProfile;
75    }
76
77    public function getSelectedSkillProfile()
78    {
79        return $this->selectedSkillProfile;
80    }
81
82    public function setReachedSkillLevels($reachedSkillLevels)
83    {
84        $this->reachedSkillLevels = $reachedSkillLevels;
85    }
86
87    public function getReachedSkillLevels()
88    {
89        return $this->reachedSkillLevels;
90    }
91
92    public function setUsrId($usrId)
93    {
94        $this->usrId = $usrId;
95    }
96
97    public function getUsrId()
98    {
99        return $this->usrId;
100    }
101
102    /**
103     * @return int
104     */
105    public function getTestId()
106    {
107        return $this->testId;
108    }
109}
110