From abf9827f97f2dc97fd7100cf5e7d6c9808065d8e Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Mon, 7 Nov 2022 15:24:25 +0100 Subject: [PATCH 1/3] feat: Allow ruby tag be possible to add on InlineColletions --- src/qtism/data/content/xhtml/html5/Figure.php | 3 ++- src/qtism/data/content/xhtml/html5/Rb.php | 3 ++- src/qtism/data/content/xhtml/html5/Rp.php | 3 ++- src/qtism/data/content/xhtml/html5/Rt.php | 3 ++- src/qtism/data/content/xhtml/html5/Ruby.php | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/qtism/data/content/xhtml/html5/Figure.php b/src/qtism/data/content/xhtml/html5/Figure.php index 89d03ab57..8022ee026 100644 --- a/src/qtism/data/content/xhtml/html5/Figure.php +++ b/src/qtism/data/content/xhtml/html5/Figure.php @@ -25,8 +25,9 @@ use qtism\data\content\FlowCollection; use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; +use qtism\data\content\Inline; -class Figure extends Html5Element implements FlowStatic +class Figure extends Html5Element implements FlowStatic, Inline { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Rb.php b/src/qtism/data/content/xhtml/html5/Rb.php index d24397ec0..4302bafbc 100644 --- a/src/qtism/data/content/xhtml/html5/Rb.php +++ b/src/qtism/data/content/xhtml/html5/Rb.php @@ -24,9 +24,10 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; +use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rb extends Html5Element implements FlowStatic +class Rb extends Html5Element implements FlowStatic, Inline { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Rp.php b/src/qtism/data/content/xhtml/html5/Rp.php index 06e4b5220..a53598dd0 100644 --- a/src/qtism/data/content/xhtml/html5/Rp.php +++ b/src/qtism/data/content/xhtml/html5/Rp.php @@ -24,9 +24,10 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; +use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rp extends Html5Element implements FlowStatic +class Rp extends Html5Element implements FlowStatic, Inline { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Rt.php b/src/qtism/data/content/xhtml/html5/Rt.php index 58772cfed..a61ce3961 100644 --- a/src/qtism/data/content/xhtml/html5/Rt.php +++ b/src/qtism/data/content/xhtml/html5/Rt.php @@ -24,9 +24,10 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; +use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rt extends Html5Element implements FlowStatic +class Rt extends Html5Element implements FlowStatic, Inline { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Ruby.php b/src/qtism/data/content/xhtml/html5/Ruby.php index 8e18e605b..f77878505 100644 --- a/src/qtism/data/content/xhtml/html5/Ruby.php +++ b/src/qtism/data/content/xhtml/html5/Ruby.php @@ -25,8 +25,9 @@ use qtism\data\content\FlowCollection; use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; +use qtism\data\content\Inline; -class Ruby extends Html5Element implements FlowStatic +class Ruby extends Html5Element implements FlowStatic, Inline { use FlowTrait; From a4e04f53dc6848f9a700bc7f88c61a7d5946ed25 Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Tue, 8 Nov 2022 12:52:02 +0100 Subject: [PATCH 2/3] fix: keep inner elements like block --- src/qtism/data/content/xhtml/html5/Rb.php | 3 +-- src/qtism/data/content/xhtml/html5/Rp.php | 3 +-- src/qtism/data/content/xhtml/html5/Rt.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/qtism/data/content/xhtml/html5/Rb.php b/src/qtism/data/content/xhtml/html5/Rb.php index 4302bafbc..d24397ec0 100644 --- a/src/qtism/data/content/xhtml/html5/Rb.php +++ b/src/qtism/data/content/xhtml/html5/Rb.php @@ -24,10 +24,9 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; -use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rb extends Html5Element implements FlowStatic, Inline +class Rb extends Html5Element implements FlowStatic { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Rp.php b/src/qtism/data/content/xhtml/html5/Rp.php index a53598dd0..06e4b5220 100644 --- a/src/qtism/data/content/xhtml/html5/Rp.php +++ b/src/qtism/data/content/xhtml/html5/Rp.php @@ -24,10 +24,9 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; -use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rp extends Html5Element implements FlowStatic, Inline +class Rp extends Html5Element implements FlowStatic { use FlowTrait; diff --git a/src/qtism/data/content/xhtml/html5/Rt.php b/src/qtism/data/content/xhtml/html5/Rt.php index a61ce3961..58772cfed 100644 --- a/src/qtism/data/content/xhtml/html5/Rt.php +++ b/src/qtism/data/content/xhtml/html5/Rt.php @@ -24,10 +24,9 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; -use qtism\data\content\Inline; use qtism\data\content\InlineCollection; -class Rt extends Html5Element implements FlowStatic, Inline +class Rt extends Html5Element implements FlowStatic { use FlowTrait; From 9fac0ccad351f6ac98cc0a6cb39a8e47f622c6fd Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Thu, 10 Nov 2022 16:24:38 +0100 Subject: [PATCH 3/3] feat: extend list of possible elemnts interact with ruby tag --- src/qtism/data/content/xhtml/html5/Ruby.php | 4 +++- .../data/storage/xml/marshalling/GapChoiceMarshaller.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qtism/data/content/xhtml/html5/Ruby.php b/src/qtism/data/content/xhtml/html5/Ruby.php index f77878505..8c2119835 100644 --- a/src/qtism/data/content/xhtml/html5/Ruby.php +++ b/src/qtism/data/content/xhtml/html5/Ruby.php @@ -26,8 +26,10 @@ use qtism\data\content\FlowStatic; use qtism\data\content\FlowTrait; use qtism\data\content\Inline; +use qtism\data\content\InlineStatic; +use qtism\data\content\TextOrVariable; -class Ruby extends Html5Element implements FlowStatic, Inline +class Ruby extends Html5Element implements FlowStatic, Inline, TextOrVariable, InlineStatic { use FlowTrait; diff --git a/src/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php b/src/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php index 2410cbdc8..5761e46f9 100644 --- a/src/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php +++ b/src/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php @@ -30,6 +30,7 @@ use qtism\common\utils\Version; use qtism\data\content\FlowStaticCollection; use qtism\data\content\TextOrVariableCollection; +use qtism\data\content\xhtml\html5\Ruby; use qtism\data\QtiComponent; use qtism\data\QtiComponentCollection; use qtism\data\ShowHide; @@ -69,6 +70,7 @@ class GapChoiceMarshaller extends ContentMarshaller 'textRun', 'tt', 'var', + Ruby::QTI_CLASS_NAME ]; /**