Allows connect skills with course tools.pull/2458/head
parent
0a1b19d699
commit
93a64d5f4a
@ -0,0 +1,38 @@ |
||||
|
||||
<h3>{{ user.complete_name_with_username }}</h3> |
||||
<br /> |
||||
<table class="table table-striped"> |
||||
<tr> |
||||
<th>{{ 'Skill' | get_lang }}</th> |
||||
<th>{{ 'Occurrences' | get_lang }}</th> |
||||
<th>{{ 'Conclusion' | get_lang }}</th> |
||||
</tr> |
||||
|
||||
{% for skill in skills %} |
||||
<tr> |
||||
<td>{{ skill.name }}</td> |
||||
<td> |
||||
{% for item in items[skill.id] %} |
||||
{% set status = 'danger' %} |
||||
{% if item.info.status %} |
||||
{% set status = 'success' %} |
||||
{% endif %} |
||||
<span class="label label-{{ status }}"> |
||||
{{ item.info.name }} |
||||
</span> |
||||
{% endfor %} |
||||
</td> |
||||
<td> |
||||
{% if conclusion_list[skill.id] %} |
||||
<span class="label label-success"> |
||||
{{ 'Achieved' }} |
||||
</span> |
||||
{% else %} |
||||
<span class="label label-danger"> |
||||
{{ 'NotYetAchieved' }} |
||||
</span> |
||||
{% endif %} |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</table> |
||||
@ -0,0 +1,363 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\SkillBundle\Entity; |
||||
|
||||
use Chamilo\CoreBundle\Entity\Skill; |
||||
use Doctrine\ORM\Mapping as ORM; |
||||
use Gedmo\Mapping\Annotation as Gedmo; |
||||
|
||||
/** |
||||
* SkillRelItem |
||||
* |
||||
* @ORM\Table(name="skill_rel_item") |
||||
* ORM\Entity // uncomment if api_get_configuration_value('allow_skill_rel_items') |
||||
*/ |
||||
class SkillRelItem |
||||
{ |
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Skill", inversedBy="items") |
||||
* @ORM\JoinColumn(name="skill_id", referencedColumnName="id") |
||||
**/ |
||||
protected $skill; |
||||
|
||||
/** |
||||
* See ITEM_TYPE_* constants in api.lib.php |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="item_type", type="integer", nullable=false) |
||||
*/ |
||||
protected $itemType; |
||||
|
||||
/** |
||||
* iid value |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="item_id", type="integer", nullable=false) |
||||
*/ |
||||
protected $itemId; |
||||
|
||||
/** |
||||
* A text expressing what has to be achieved |
||||
* (view, finish, get more than X score, finishing all children skills, etc), |
||||
* @var string |
||||
* |
||||
* @ORM\Column(name="obtain_conditions", type="string", length=255, nullable=true) |
||||
*/ |
||||
protected $obtainConditions; |
||||
|
||||
/** |
||||
* if it requires validation by a teacher |
||||
* @var bool |
||||
* |
||||
* @ORM\Column(name="requires_validation", type="boolean") |
||||
*/ |
||||
protected $requiresValidation; |
||||
|
||||
/** |
||||
* Set to false if this is a children skill used only to obtain a higher-level skill, |
||||
* so a skill with is_real = false never appears in a student portfolio/backpack |
||||
* @var bool |
||||
* |
||||
* @ORM\Column(name="is_real", type="boolean") |
||||
*/ |
||||
protected $isReal; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="c_id", type="integer", nullable=true) |
||||
*/ |
||||
protected $courseId; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="session_id", type="integer", nullable=true) |
||||
*/ |
||||
protected $sessionId; |
||||
|
||||
/** |
||||
* @var \DateTime $created |
||||
* |
||||
* @Gedmo\Timestampable(on="create") |
||||
* @ORM\Column(name="created_at", type="datetime") |
||||
*/ |
||||
protected $createdAt; |
||||
|
||||
/** |
||||
* @var \DateTime $updated |
||||
* |
||||
* @Gedmo\Timestampable(on="update") |
||||
* @ORM\Column(name="updated_at", type="datetime") |
||||
*/ |
||||
protected $updatedAt; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="created_by", type="integer", nullable=false) |
||||
*/ |
||||
protected $createdBy; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="updated_by", type="integer", nullable=false) |
||||
*/ |
||||
protected $updatedBy; |
||||
|
||||
/** |
||||
* SkillRelItem constructor. |
||||
*/ |
||||
public function __construct() |
||||
{ |
||||
$this->createdAt = new \DateTime('now'); |
||||
$this->updatedAt = new \DateTime('now'); |
||||
$this->isReal = false; |
||||
$this->requiresValidation = false; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
/** |
||||
* @param int $id |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setId($id) |
||||
{ |
||||
$this->id = $id; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return Skill |
||||
*/ |
||||
public function getSkill() |
||||
{ |
||||
return $this->skill; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $skill |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setSkill($skill) |
||||
{ |
||||
$this->skill = $skill; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getItemId() |
||||
{ |
||||
return $this->itemId; |
||||
} |
||||
|
||||
/** |
||||
* @param int $itemId |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setItemId($itemId) |
||||
{ |
||||
$this->itemId = $itemId; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return string |
||||
*/ |
||||
public function getObtainConditions() |
||||
{ |
||||
return $this->obtainConditions; |
||||
} |
||||
|
||||
/** |
||||
* @param string $obtainConditions |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setObtainConditions($obtainConditions) |
||||
{ |
||||
$this->obtainConditions = $obtainConditions; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return bool |
||||
*/ |
||||
public function isRequiresValidation() |
||||
{ |
||||
return $this->requiresValidation; |
||||
} |
||||
|
||||
/** |
||||
* @param bool $requiresValidation |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setRequiresValidation($requiresValidation) |
||||
{ |
||||
$this->requiresValidation = $requiresValidation; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return bool |
||||
*/ |
||||
public function isReal() |
||||
{ |
||||
return $this->isReal; |
||||
} |
||||
|
||||
/** |
||||
* @param bool $isReal |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setIsReal($isReal) |
||||
{ |
||||
$this->isReal = $isReal; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return \DateTime |
||||
*/ |
||||
public function getCreatedAt() |
||||
{ |
||||
return $this->createdAt; |
||||
} |
||||
|
||||
/** |
||||
* @param \DateTime $createdAt |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setCreatedAt($createdAt) |
||||
{ |
||||
$this->createdAt = $createdAt; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return \DateTime |
||||
*/ |
||||
public function getUpdatedAt() |
||||
{ |
||||
return $this->updatedAt; |
||||
} |
||||
|
||||
/** |
||||
* @param \DateTime $updatedAt |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setUpdatedAt($updatedAt) |
||||
{ |
||||
$this->updatedAt = $updatedAt; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getCreatedBy() |
||||
{ |
||||
return $this->createdBy; |
||||
} |
||||
|
||||
/** |
||||
* @param int $createdBy |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setCreatedBy($createdBy) |
||||
{ |
||||
$this->createdBy = $createdBy; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getUpdatedBy() |
||||
{ |
||||
return $this->updatedBy; |
||||
} |
||||
|
||||
/** |
||||
* @param int $updatedBy |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setUpdatedBy($updatedBy) |
||||
{ |
||||
$this->updatedBy = $updatedBy; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getItemType() |
||||
{ |
||||
return $this->itemType; |
||||
} |
||||
|
||||
/** |
||||
* @param int $itemType |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setItemType($itemType) |
||||
{ |
||||
$this->itemType = $itemType; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getCourseId() |
||||
{ |
||||
return $this->courseId; |
||||
} |
||||
|
||||
/** |
||||
* @param int $courseId |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setCourseId($courseId) |
||||
{ |
||||
$this->courseId = $courseId; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getSessionId() |
||||
{ |
||||
return $this->sessionId; |
||||
} |
||||
|
||||
/** |
||||
* @param int $sessionId |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function setSessionId($sessionId) |
||||
{ |
||||
$this->sessionId = $sessionId; |
||||
return $this; |
||||
} |
||||
} |
||||
@ -0,0 +1,169 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\SkillBundle\Entity; |
||||
|
||||
use Chamilo\UserBundle\Entity\User; |
||||
use Doctrine\ORM\Mapping as ORM; |
||||
use Gedmo\Mapping\Annotation as Gedmo; |
||||
|
||||
/** |
||||
* SkillRelItemRelUser |
||||
* |
||||
* @ORM\Table(name="skill_rel_item_rel_user") |
||||
* ORM\Entity // uncomment if api_get_configuration_value('allow_skill_rel_items') |
||||
*/ |
||||
class SkillRelItemRelUser |
||||
{ |
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* @var SkillRelItem |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\SkillBundle\Entity\SkillRelItem", cascade={"persist"}) |
||||
* @ORM\JoinColumn(name="skill_rel_item_id", referencedColumnName="id", nullable=false) |
||||
*/ |
||||
protected $skillRelItem; |
||||
|
||||
/** |
||||
* @var User |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"}) |
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false) |
||||
*/ |
||||
protected $user; |
||||
|
||||
/** |
||||
* @var \DateTime $created |
||||
* |
||||
* @Gedmo\Timestampable(on="create") |
||||
* @ORM\Column(name="created_at", type="datetime") |
||||
*/ |
||||
protected $createdAt; |
||||
|
||||
/** |
||||
* @var \DateTime $updated |
||||
* |
||||
* @Gedmo\Timestampable(on="update") |
||||
* @ORM\Column(name="updated_at", type="datetime") |
||||
*/ |
||||
protected $updatedAt; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="created_by", type="integer", nullable=false) |
||||
*/ |
||||
protected $createdBy; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="updated_by", type="integer", nullable=false) |
||||
*/ |
||||
protected $updatedBy; |
||||
|
||||
/** |
||||
* SkillRelItemRelUser constructor. |
||||
*/ |
||||
public function __construct() |
||||
{ |
||||
$this->createdAt = new \DateTime('now'); |
||||
$this->updatedAt = new \DateTime('now'); |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
/** |
||||
* @param int $id |
||||
* @return SkillRelItemRelUser |
||||
*/ |
||||
public function setId($id) |
||||
{ |
||||
$this->id = $id; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return SkillRelItem |
||||
*/ |
||||
public function getSkillRelItem() |
||||
{ |
||||
return $this->skillRelItem; |
||||
} |
||||
|
||||
/** |
||||
* @param SkillRelItem $skillRelItem |
||||
* @return SkillRelItemRelUser |
||||
*/ |
||||
public function setSkillRelItem($skillRelItem) |
||||
{ |
||||
$this->skillRelItem = $skillRelItem; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return User |
||||
*/ |
||||
public function getUser() |
||||
{ |
||||
return $this->user; |
||||
} |
||||
|
||||
/** |
||||
* @param User $user |
||||
* @return SkillRelItemRelUser |
||||
*/ |
||||
public function setUser($user) |
||||
{ |
||||
$this->user = $user; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getCreatedBy() |
||||
{ |
||||
return $this->createdBy; |
||||
} |
||||
|
||||
/** |
||||
* @param int $createdBy |
||||
* @return SkillRelItemRelUser |
||||
*/ |
||||
public function setCreatedBy($createdBy) |
||||
{ |
||||
$this->createdBy = $createdBy; |
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getUpdatedBy() |
||||
{ |
||||
return $this->updatedBy; |
||||
} |
||||
|
||||
/** |
||||
* @param int $updatedBy |
||||
* @return SkillRelItemRelUser |
||||
*/ |
||||
public function setUpdatedBy($updatedBy) |
||||
{ |
||||
$this->updatedBy = $updatedBy; |
||||
return $this; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue