From a07292b9dd5542c3cccda11d76a6803448171d5c Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Mon, 7 Nov 2022 15:32:13 +0100 Subject: [PATCH 1/4] feat: Allow ruby tag be possible to add on InlineColletions --- qtism/data/content/xhtml/html5/Figcaption.php | 4 +--- qtism/data/content/xhtml/html5/Figure.php | 4 ++-- qtism/data/content/xhtml/html5/Rb.php | 4 ++-- qtism/data/content/xhtml/html5/Rp.php | 4 ++-- qtism/data/content/xhtml/html5/Rt.php | 4 ++-- qtism/data/content/xhtml/html5/Ruby.php | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/qtism/data/content/xhtml/html5/Figcaption.php b/qtism/data/content/xhtml/html5/Figcaption.php index cfcd2b966..910c30f71 100644 --- a/qtism/data/content/xhtml/html5/Figcaption.php +++ b/qtism/data/content/xhtml/html5/Figcaption.php @@ -22,9 +22,7 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; - -class Figcaption extends Html5LayoutElement implements FlowStatic +class Figcaption extends Html5LayoutElement { public const QTI_CLASS_NAME_FIGCAPTION = 'figcaption'; diff --git a/qtism/data/content/xhtml/html5/Figure.php b/qtism/data/content/xhtml/html5/Figure.php index 221923010..8f3dfb8f5 100644 --- a/qtism/data/content/xhtml/html5/Figure.php +++ b/qtism/data/content/xhtml/html5/Figure.php @@ -20,12 +20,12 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; +use qtism\data\content\Inline; /** * The XHTML figure class. */ -class Figure extends Html5LayoutElement implements FlowStatic +class Figure extends Html5LayoutElement implements Inline { public const QTI_CLASS_NAME_FIGURE = 'figure'; diff --git a/qtism/data/content/xhtml/html5/Rb.php b/qtism/data/content/xhtml/html5/Rb.php index 72a50a8f6..1666286fe 100644 --- a/qtism/data/content/xhtml/html5/Rb.php +++ b/qtism/data/content/xhtml/html5/Rb.php @@ -22,9 +22,9 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; +use qtism\data\content\Inline; -class Rb extends Html5LayoutElement implements FlowStatic +class Rb extends Html5LayoutElement implements Inline { public const QTI_CLASS_NAME = 'rb'; diff --git a/qtism/data/content/xhtml/html5/Rp.php b/qtism/data/content/xhtml/html5/Rp.php index f284969da..dfe8822ed 100644 --- a/qtism/data/content/xhtml/html5/Rp.php +++ b/qtism/data/content/xhtml/html5/Rp.php @@ -22,9 +22,9 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; +use qtism\data\content\Inline; -class Rp extends Html5LayoutElement implements FlowStatic +class Rp extends Html5LayoutElement implements Inline { public const QTI_CLASS_NAME = 'rp'; diff --git a/qtism/data/content/xhtml/html5/Rt.php b/qtism/data/content/xhtml/html5/Rt.php index c255adb24..fa827bc54 100644 --- a/qtism/data/content/xhtml/html5/Rt.php +++ b/qtism/data/content/xhtml/html5/Rt.php @@ -22,9 +22,9 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; +use qtism\data\content\Inline; -class Rt extends Html5LayoutElement implements FlowStatic +class Rt extends Html5LayoutElement implements Inline { public const QTI_CLASS_NAME = 'rt'; diff --git a/qtism/data/content/xhtml/html5/Ruby.php b/qtism/data/content/xhtml/html5/Ruby.php index 473530377..89c8865a6 100644 --- a/qtism/data/content/xhtml/html5/Ruby.php +++ b/qtism/data/content/xhtml/html5/Ruby.php @@ -22,9 +22,9 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\FlowStatic; +use qtism\data\content\Inline; -class Ruby extends Html5LayoutElement implements FlowStatic +class Ruby extends Html5LayoutElement implements Inline { public const QTI_CLASS_NAME = 'ruby'; From 185128d727aafadc0189ea50482114c1c0e6f224 Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Tue, 8 Nov 2022 12:49:08 +0100 Subject: [PATCH 2/4] fix: keep inner elements like block --- qtism/data/content/xhtml/html5/Rb.php | 4 +--- qtism/data/content/xhtml/html5/Rp.php | 4 +--- qtism/data/content/xhtml/html5/Rt.php | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/qtism/data/content/xhtml/html5/Rb.php b/qtism/data/content/xhtml/html5/Rb.php index 1666286fe..3a08d2ff0 100644 --- a/qtism/data/content/xhtml/html5/Rb.php +++ b/qtism/data/content/xhtml/html5/Rb.php @@ -22,9 +22,7 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\Inline; - -class Rb extends Html5LayoutElement implements Inline +class Rb extends Html5LayoutElement { public const QTI_CLASS_NAME = 'rb'; diff --git a/qtism/data/content/xhtml/html5/Rp.php b/qtism/data/content/xhtml/html5/Rp.php index dfe8822ed..6f0e4652d 100644 --- a/qtism/data/content/xhtml/html5/Rp.php +++ b/qtism/data/content/xhtml/html5/Rp.php @@ -22,9 +22,7 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\Inline; - -class Rp extends Html5LayoutElement implements Inline +class Rp extends Html5LayoutElement { public const QTI_CLASS_NAME = 'rp'; diff --git a/qtism/data/content/xhtml/html5/Rt.php b/qtism/data/content/xhtml/html5/Rt.php index fa827bc54..34737dee9 100644 --- a/qtism/data/content/xhtml/html5/Rt.php +++ b/qtism/data/content/xhtml/html5/Rt.php @@ -22,9 +22,7 @@ namespace qtism\data\content\xhtml\html5; -use qtism\data\content\Inline; - -class Rt extends Html5LayoutElement implements Inline +class Rt extends Html5LayoutElement { public const QTI_CLASS_NAME = 'rt'; From d80f8587042f42df900b1406d676237d004982a0 Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Thu, 10 Nov 2022 12:03:44 +0100 Subject: [PATCH 3/4] fix: allow ruby be added to choice inline --- qtism/data/content/xhtml/html5/Figure.php | 3 ++- qtism/data/content/xhtml/html5/Ruby.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qtism/data/content/xhtml/html5/Figure.php b/qtism/data/content/xhtml/html5/Figure.php index 8f3dfb8f5..be7dea05e 100644 --- a/qtism/data/content/xhtml/html5/Figure.php +++ b/qtism/data/content/xhtml/html5/Figure.php @@ -21,11 +21,12 @@ namespace qtism\data\content\xhtml\html5; use qtism\data\content\Inline; +use qtism\data\content\TextOrVariable; /** * The XHTML figure class. */ -class Figure extends Html5LayoutElement implements Inline +class Figure extends Html5LayoutElement implements Inline, TextOrVariable { public const QTI_CLASS_NAME_FIGURE = 'figure'; diff --git a/qtism/data/content/xhtml/html5/Ruby.php b/qtism/data/content/xhtml/html5/Ruby.php index 89c8865a6..110ea7cb2 100644 --- a/qtism/data/content/xhtml/html5/Ruby.php +++ b/qtism/data/content/xhtml/html5/Ruby.php @@ -23,8 +23,9 @@ namespace qtism\data\content\xhtml\html5; use qtism\data\content\Inline; +use qtism\data\content\TextOrVariable; -class Ruby extends Html5LayoutElement implements Inline +class Ruby extends Html5LayoutElement implements Inline, TextOrVariable { public const QTI_CLASS_NAME = 'ruby'; From 2bf76e0b48bef137cb9032279f5ea0622eef5b2d Mon Sep 17 00:00:00 2001 From: Vitalii Shtykhno Date: Thu, 10 Nov 2022 14:26:29 +0100 Subject: [PATCH 4/4] fix: allow ruby be marshaling inside GapElements --- qtism/data/content/xhtml/html5/Ruby.php | 5 ++++- qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qtism/data/content/xhtml/html5/Ruby.php b/qtism/data/content/xhtml/html5/Ruby.php index 110ea7cb2..a36f913ec 100644 --- a/qtism/data/content/xhtml/html5/Ruby.php +++ b/qtism/data/content/xhtml/html5/Ruby.php @@ -23,9 +23,10 @@ namespace qtism\data\content\xhtml\html5; use qtism\data\content\Inline; +use qtism\data\content\InlineStatic; use qtism\data\content\TextOrVariable; -class Ruby extends Html5LayoutElement implements Inline, TextOrVariable +class Ruby extends Html5LayoutElement implements Inline, TextOrVariable, InlineStatic { public const QTI_CLASS_NAME = 'ruby'; @@ -34,3 +35,5 @@ public function getQtiClassName() return self::QTI_CLASS_NAME; } } + + diff --git a/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php b/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php index f14ea3f25..47b6e64af 100644 --- a/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php +++ b/qtism/data/storage/xml/marshalling/GapChoiceMarshaller.php @@ -26,6 +26,7 @@ use DOMElement; use InvalidArgumentException; use qtism\data\content\FlowStaticCollection; +use qtism\data\content\xhtml\html5\Ruby; use qtism\data\QtiComponent; use qtism\data\QtiComponentCollection; use qtism\data\ShowHide; @@ -65,6 +66,7 @@ class GapChoiceMarshaller extends ContentMarshaller 'textRun', 'tt', 'var', + Ruby::QTI_CLASS_NAME ]; /**