Update exercise toolbars BT#17381

pull/3291/head
Julio Montoya 5 years ago
parent 86bcc15081
commit 8b1719ce7b
  1. 1
      main/exercise/matching.class.php
  2. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  3. 27
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestMatching.php
  4. 13
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php
  5. 19
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php

@ -148,7 +148,6 @@ class Matching extends Question
$form->addHtml('<tr>');
$form->addHtml("<td>$i</td>");
//$form->addText("answer[$i]", null);
$form->addHtmlEditor(
"answer[$i]",
null,

@ -224,7 +224,7 @@ class Basic extends Toolbar
*/
public function getNewPageBlock()
{
return ['NewPage', 'Templates', '-', 'PasteFromWord', 'inserthtml'];
return ['NewPage', 'Templates', '-', 'PasteFromWord', 'inserthtml'];
}
/**

@ -1,12 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* TestFreeAnswer toolbar configuration.
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class TestMatching extends Basic
{
@ -17,7 +16,7 @@ class TestMatching extends Basic
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
if (api_get_setting('more_buttons_maximized_mode') !== 'true') {
$config['toolbar'] = $this->getNormalToolbar();
} else {
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
@ -25,7 +24,7 @@ class TestMatching extends Basic
}
$config['fullPage'] = false;
$config['extraPlugins'] = 'wordcount';
$config['extraPlugins'] = $this->getPluginsToString();
$config['wordcount'] = [
// Whether or not you want to show the Word Count
'showWordCount' => true,
@ -37,8 +36,6 @@ class TestMatching extends Basic
'wordLimit' => 'unlimited',
];
//$config['height'] = '200';
return $config;
}
@ -73,7 +70,7 @@ class TestMatching extends Basic
['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'TextColor', 'BGColor'],
[api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''],
[api_get_setting('allow_spellcheck') === 'true' ? 'Scayt' : ''],
['Styles', 'Format', 'Font', 'FontSize'],
['PageBreak', 'ShowBlocks'],
['Toolbarswitch'],
@ -92,6 +89,7 @@ class TestMatching extends Basic
'Maximize',
'Bold',
'Image',
'Video',
'Link',
'PasteFromWord',
'Audio',
@ -111,9 +109,20 @@ class TestMatching extends Basic
protected function getMinimizedToolbar()
{
return [
$this->getNewPageBlock(),
['PasteFromWord'],
['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath'],
[
'Link',
'Image',
'Video',
'Flash',
'Oembed',
'Youtube',
'VimeoEmbed',
'Audio',
'Table',
'Asciimath',
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],

@ -1,12 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* TestProposedAnswer toolbar configuration.
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class TestProposedAnswer extends Basic
{
@ -19,11 +18,10 @@ class TestProposedAnswer extends Basic
{
$config['toolbarCanCollapse'] = true;
$config['toolbarStartupExpanded'] = false;
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
if (api_get_setting('more_buttons_maximized_mode') !== 'true') {
$config['toolbar'] = $this->getNormalToolbar();
} else {
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
$config['toolbar_maxToolbar'] = $this->getMaximizedToolbar();
}
@ -50,8 +48,13 @@ class TestProposedAnswer extends Basic
return [
['Bold', 'Subscript', 'Superscript'],
[
'Image',
'Link',
'Image',
'Video',
//'Flash',
'Oembed',
//'Youtube',
'VimeoEmbed',
'Audio',
'Table',
'PasteFromWord',

@ -1,12 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* TestQuestionDescription toolbar configuration.
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class TestQuestionDescription extends Basic
{
@ -21,7 +20,6 @@ class TestQuestionDescription extends Basic
['name' => 'document', 'groups' => ['document', 'doctools']],
['name' => 'clipboard', 'groups' => ['clipboard', 'undo']],
['name' => 'editing', 'groups' => ['clipboard', 'undo']],
//array('name' => 'forms', 'groups' =>array('clipboard', 'undo', )),
'/',
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
['name' => 'paragraph', 'groups' => ['list', 'indent', 'blocks', 'align']],
@ -152,7 +150,20 @@ class TestQuestionDescription extends Basic
return [
$this->getNewPageBlock(),
['Undo', 'Redo'],
['Link', 'Unlink', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
[
'Link',
'Unlink',
'Image',
'Video',
'Flash',
'Oembed',
'Youtube',
'VimeoEmbed',
'Audio',
'Table',
'Asciimath',
'Asciisvg',
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
[

Loading…
Cancel
Save