Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/CoreBundle/Migrations/Schema/V200/Version20250529165710.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Migrations\Schema\V200;

use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;

final class Version20250529165710 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Add parent_media_id column to c_quiz_question for grouping media-related questions.';
}

public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE c_quiz_question ADD parent_media_id INT DEFAULT NULL;');
}

public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE c_quiz_question DROP COLUMN parent_media_id;');
}
}
15 changes: 15 additions & 0 deletions src/CourseBundle/Entity/CQuizQuestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface, Strin
#[ORM\Column(name: 'duration', type: 'integer', nullable: true)]
protected ?int $duration = null;

#[ORM\Column(name: 'parent_media_id', type: 'integer', nullable: true)]
protected ?int $parentMediaId = null;

public function __construct()
{
$this->categories = new ArrayCollection();
Expand Down Expand Up @@ -367,6 +370,18 @@ public function setDuration(?int $duration): self
return $this;
}

public function getParentMediaId(): ?int
{
return $this->parentMediaId;
}

public function setParentMediaId(?int $parentMediaId): self
{
$this->parentMediaId = $parentMediaId;

return $this;
}

public function getResourceIdentifier(): int|Uuid
{
return $this->getIid();
Expand Down
Loading