diff --git a/main/course_home/course_home.php b/main/course_home/course_home.php
index ccd6a714d8..7dca12daba 100755
--- a/main/course_home/course_home.php
+++ b/main/course_home/course_home.php
@@ -325,6 +325,7 @@ if ($documentAutoLaunch == 1) {
}
}
+
$tool_table = Database::get_course_table(TABLE_TOOL_LIST);
/* Introduction section (editable by course admins) */
diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php
index 773442604a..b2f8cb1d3b 100755
--- a/main/course_info/infocours.php
+++ b/main/course_info/infocours.php
@@ -836,9 +836,15 @@ $groupNotification = [
$form->createElement('radio', 'hide_forum_notifications', null, get_lang('No'), 2),
];
+$addUsers = [
+ $form->createElement('radio', 'subscribe_users_to_forum_notifications', null, get_lang('Yes'), 1),
+ $form->createElement('radio', 'subscribe_users_to_forum_notifications', null, get_lang('No'), 2),
+];
+
$globalGroup = [
get_lang('EnableForumAutoLaunch') => $group,
get_lang('HideForumNotifications') => $groupNotification,
+ get_lang('SubscribeUsersToAllForumNotifications') => $addUsers,
'' => $myButton,
];
diff --git a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Minimal.php b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Minimal.php
index 3b530e11eb..25b0d3c54f 100644
--- a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Minimal.php
+++ b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/Minimal.php
@@ -24,7 +24,7 @@ class Minimal extends Basic
[
'name' => 'basicstyles',
'groups' => ['basicstyles', 'cleanup'],
- 'items' => ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript'],
+ 'items' => ['Bold', 'Italic', 'Underline', 'Strike', 'TextColor'],
],
[
'name' => 'paragraph',
diff --git a/src/CoreBundle/Component/Editor/CkEditor/Toolbar/TitleAsHtml.php b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/TitleAsHtml.php
new file mode 100644
index 0000000000..230a72f00f
--- /dev/null
+++ b/src/CoreBundle/Component/Editor/CkEditor/Toolbar/TitleAsHtml.php
@@ -0,0 +1,44 @@
+ 'clipboard',
+ 'groups' => ['clipboard', 'undo'],
+ 'items' => ['Cut', 'Copy', 'Paste', '-', 'Undo', 'Redo'],
+ ],
+ [
+ 'name' => 'basicstyles',
+ 'groups' => ['basicstyles', 'cleanup'],
+ 'items' => ['Bold', 'Italic', 'Underline', 'Strike', 'TextColor', 'BGColor'],
+ ],
+// [
+// 'name' => 'paragraph',
+// 'groups' => ['list', 'indent', 'blocks', 'align', 'bidi'],
+// 'items' => ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
+// ],
+ [
+ 'name' => 'links',
+ 'items' => ['Link', 'Unlink', 'Source'],
+ ],
+ ];
+
+ $config['height'] = '100';
+
+ return $config;
+ }
+}
diff --git a/src/CoreBundle/Component/Editor/Editor.php b/src/CoreBundle/Component/Editor/Editor.php
index c17bcb0ffe..ab7e188adf 100644
--- a/src/CoreBundle/Component/Editor/Editor.php
+++ b/src/CoreBundle/Component/Editor/Editor.php
@@ -13,6 +13,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
class Editor
{
+ /**
+ * @var string
+ */
+ public $textareaId;
+
/**
* Name of the instance.
*
@@ -85,6 +90,26 @@ class Editor
$this->name = $name;
}
+ /**
+ * @return string
+ */
+ public function getTextareaId()
+ {
+ return $this->textareaId;
+ }
+
+ /**
+ * @param string $textareaId
+ *
+ * @return Editor
+ */
+ public function setTextareaId($textareaId)
+ {
+ $this->textareaId = $textareaId;
+
+ return $this;
+ }
+
/**
* Return the HTML code required to run editor.
*
@@ -94,7 +119,7 @@ class Editor
*/
public function createHtml($value)
{
- $html = '';
+ $html = '';
return $html;
}
diff --git a/src/CourseBundle/Component/CourseCopy/Course.php b/src/CourseBundle/Component/CourseCopy/Course.php
index 113a3ff833..476a7bfc80 100644
--- a/src/CourseBundle/Component/CourseCopy/Course.php
+++ b/src/CourseBundle/Component/CourseCopy/Course.php
@@ -70,18 +70,18 @@ class Course
/**
* Does this course has resources?
*
- * @param int $resource_type Check if this course has resources of the
+ * @param int $type Check if this course has resources of the
* given type. If no type is given, check if course has resources of any
* type.
*
* @return bool
*/
- public function has_resources($resource_type = null)
+ public function has_resources($type = null)
{
- if ($resource_type != null) {
+ if ($type != null) {
return
- isset($this->resources[$resource_type]) && is_array($this->resources[$resource_type]) && (
- count($this->resources[$resource_type]) > 0
+ isset($this->resources[$type]) && is_array($this->resources[$type]) && (
+ count($this->resources[$type]) > 0
);
}
@@ -109,6 +109,9 @@ class Course
$description = '';
switch ($type) {
case RESOURCE_ANNOUNCEMENT:
+ case RESOURCE_EVENT:
+ case RESOURCE_THEMATIC:
+ case RESOURCE_WIKI:
$title = $resource->title;
$description = $resource->content;
break;
@@ -116,16 +119,13 @@ class Course
$title = $resource->title;
$description = $resource->comment;
break;
- case RESOURCE_EVENT:
- $title = $resource->title;
- $description = $resource->content;
- break;
case RESOURCE_FORUM:
- $title = $resource->title;
- $description = $resource->description;
- break;
-
case RESOURCE_FORUMCATEGORY:
+ case RESOURCE_LINK:
+ case RESOURCE_LINKCATEGORY:
+ case RESOURCE_QUIZ:
+ case RESOURCE_TEST_CATEGORY:
+ case RESOURCE_WORK:
$title = $resource->title;
$description = $resource->description;
break;
@@ -133,13 +133,11 @@ class Course
$title = $resource->title;
$description = $resource->text;
break;
+ case RESOURCE_SCORM:
case RESOURCE_FORUMTOPIC:
$title = $resource->title;
break;
case RESOURCE_GLOSSARY:
- $title = $resource->name;
- $description = $resource->description;
- break;
case RESOURCE_LEARNPATH:
$title = $resource->name;
$description = $resource->description;
@@ -147,29 +145,10 @@ class Course
case RESOURCE_LEARNPATH_CATEGORY:
$title = $resource->name;
break;
- case RESOURCE_LINK:
- $title = $resource->title;
- $description = $resource->description;
- break;
- case RESOURCE_LINKCATEGORY:
- $title = $resource->title;
- $description = $resource->description;
- break;
- case RESOURCE_QUIZ:
- $title = $resource->title;
- $description = $resource->description;
- break;
- case RESOURCE_TEST_CATEGORY:
- $title = $resource->title;
- $description = $resource->description;
- break;
case RESOURCE_QUIZQUESTION:
$title = $resource->question;
$description = $resource->description;
break;
- case RESOURCE_SCORM:
- $title = $resource->title;
- break;
case RESOURCE_SURVEY:
$title = $resource->title;
$description = $resource->subtitle;
@@ -181,22 +160,10 @@ class Course
case RESOURCE_TOOL_INTRO:
$description = $resource->intro_text;
break;
- case RESOURCE_WIKI:
- $title = $resource->title;
- $description = $resource->content;
- break;
- case RESOURCE_THEMATIC:
- $title = $resource->title;
- $description = $resource->content;
- break;
case RESOURCE_ATTENDANCE:
$title = $resource->params['name'];
$description = $resource->params['description'];
break;
- case RESOURCE_WORK:
- $title = $resource->title;
- $description = $resource->description;
- break;
default:
break;
}
@@ -234,6 +201,7 @@ class Course
foreach ($resources as &$resource) {
switch ($type) {
case RESOURCE_ANNOUNCEMENT:
+ case RESOURCE_EVENT:
$resource->title = api_to_system_encoding($resource->title, $this->encoding);
$resource->content = api_to_system_encoding($resource->content, $this->encoding);
break;
@@ -241,15 +209,12 @@ class Course
$resource->title = api_to_system_encoding($resource->title, $this->encoding);
$resource->comment = api_to_system_encoding($resource->comment, $this->encoding);
break;
- case RESOURCE_EVENT:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->content = api_to_system_encoding($resource->content, $this->encoding);
- break;
case RESOURCE_FORUM:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->description = api_to_system_encoding($resource->description, $this->encoding);
- break;
+ case RESOURCE_QUIZ:
case RESOURCE_FORUMCATEGORY:
+ case RESOURCE_LINK:
+ case RESOURCE_LINKCATEGORY:
+ case RESOURCE_TEST_CATEGORY:
$resource->title = api_to_system_encoding($resource->title, $this->encoding);
$resource->description = api_to_system_encoding($resource->description, $this->encoding);
break;
@@ -273,18 +238,6 @@ class Course
$resource->content_maker = api_to_system_encoding($resource->content_maker, $this->encoding);
$resource->content_license = api_to_system_encoding($resource->content_license, $this->encoding);
break;
- case RESOURCE_LINK:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->description = api_to_system_encoding($resource->description, $this->encoding);
- break;
- case RESOURCE_LINKCATEGORY:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->description = api_to_system_encoding($resource->description, $this->encoding);
- break;
- case RESOURCE_QUIZ:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->description = api_to_system_encoding($resource->description, $this->encoding);
- break;
case RESOURCE_QUIZQUESTION:
$resource->question = api_to_system_encoding($resource->question, $this->encoding);
$resource->description = api_to_system_encoding($resource->description, $this->encoding);
@@ -295,10 +248,6 @@ class Course
}
}
break;
- case RESOURCE_TEST_CATEGORY:
- $resource->title = api_to_system_encoding($resource->title, $this->encoding);
- $resource->description = api_to_system_encoding($resource->description, $this->encoding);
- break;
case RESOURCE_SCORM:
$resource->title = api_to_system_encoding($resource->title, $this->encoding);
break;
diff --git a/src/CourseBundle/Entity/CExerciseCategory.php b/src/CourseBundle/Entity/CExerciseCategory.php
new file mode 100644
index 0000000000..0c80a0eb9c
--- /dev/null
+++ b/src/CourseBundle/Entity/CExerciseCategory.php
@@ -0,0 +1,219 @@
+createdAt = new \DateTime();
+ $this->updatedAt = new \DateTime();
+ }
+
+ /**
+ * @return int
+ */
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ /**
+ * @param int $id
+ *
+ * @return CExerciseCategory
+ */
+ public function setId($id)
+ {
+ $this->id = $id;
+
+ return $this;
+ }
+
+ /**
+ * @return int
+ */
+ public function getCId()
+ {
+ return $this->cId;
+ }
+
+ /**
+ * @param int $cId
+ *
+ * @return CExerciseCategory
+ */
+ public function setCId($cId)
+ {
+ $this->cId = $cId;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return CExerciseCategory
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * @param string $description
+ *
+ * @return CExerciseCategory
+ */
+ public function setDescription($description)
+ {
+ $this->description = $description;
+
+ return $this;
+ }
+
+ /**
+ * @return \DateTime
+ */
+ public function getCreatedAt()
+ {
+ return $this->createdAt;
+ }
+
+ /**
+ * @param \DateTime $createdAt
+ *
+ * @return CExerciseCategory
+ */
+ public function setCreatedAt($createdAt)
+ {
+ $this->createdAt = $createdAt;
+
+ return $this;
+ }
+
+ /**
+ * @return \DateTime
+ */
+ public function getUpdatedAt()
+ {
+ return $this->updatedAt;
+ }
+
+ /**
+ * @param \DateTime $updatedAt
+ *
+ * @return CExerciseCategory
+ */
+ public function setUpdatedAt($updatedAt)
+ {
+ $this->updatedAt = $updatedAt;
+
+ return $this;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getPosition()
+ {
+ return $this->position;
+ }
+
+ /**
+ * @param mixed $position
+ *
+ * @return CExerciseCategory
+ */
+ public function setPosition($position)
+ {
+ $this->position = $position;
+
+ return $this;
+ }
+}
diff --git a/src/CourseBundle/Entity/CQuiz.php b/src/CourseBundle/Entity/CQuiz.php
index 2ce49c6b16..a20dc69d7e 100644
--- a/src/CourseBundle/Entity/CQuiz.php
+++ b/src/CourseBundle/Entity/CQuiz.php
@@ -210,6 +210,13 @@ class CQuiz
*/
protected $hideQuestionTitle;
+ /**
+ * @var int
+ *
+ * @ORM\Column(name="exercise_category_id", type="integer", nullable=true)
+ */
+ protected $exerciseCategoryId;
+
/**
* @var bool
*