Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
13c2c2c4
Commit
13c2c2c4
authored
8 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-742: support LaTeX in QTI 2.1 too
parent
f96f557d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/ims/qti21/ui/components/AssessmentObjectComponentRenderer.java
+31
-4
31 additions, 4 deletions
...ti21/ui/components/AssessmentObjectComponentRenderer.java
with
31 additions
and
4 deletions
src/main/java/org/olat/ims/qti21/ui/components/AssessmentObjectComponentRenderer.java
+
31
−
4
View file @
13c2c2c4
...
...
@@ -117,6 +117,7 @@ import uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.Dt;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.Li
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.Ol
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.list.Ul
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.object.Object
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.table.Col
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.table.Colgroup
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.table.Table
;
...
...
@@ -127,7 +128,7 @@ import uk.ac.ed.ph.jqtiplus.node.content.xhtml.table.Thead;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.table.Tr
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.Br
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.text.Div
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.
object.Object
;
import
uk.ac.ed.ph.jqtiplus.node.content.xhtml.
text.Span
;
import
uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem
;
import
uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback
;
import
uk.ac.ed.ph.jqtiplus.node.item.interaction.AssociateInteraction
;
...
...
@@ -540,6 +541,10 @@ public abstract class AssessmentObjectComponentRenderer extends DefaultComponent
sb
.
append
(
"<br/>"
);
break
;
}
case
Span
.
QTI_CLASS_NAME
:
{
renderSpan
(
renderer
,
sb
,
(
Span
)
inline
,
component
,
resolvedAssessmentItem
,
itemSessionState
,
ubu
,
translator
);
break
;
}
case
Object
.
QTI_CLASS_NAME
:
{
renderObject
(
sb
,
(
Object
)
inline
,
component
,
resolvedAssessmentItem
);
break
;
...
...
@@ -556,10 +561,32 @@ public abstract class AssessmentObjectComponentRenderer extends DefaultComponent
}
}
protected
final
void
renderSpan
(
AssessmentRenderer
renderer
,
StringOutput
sb
,
Span
span
,
AssessmentObjectComponent
component
,
ResolvedAssessmentItem
resolvedAssessmentItem
,
ItemSessionState
itemSessionState
,
URLBuilder
ubu
,
Translator
translator
)
{
Attribute
<?>
attrClass
=
span
.
getAttributes
().
get
(
"class"
);
if
(
attrClass
!=
null
&&
attrClass
.
getValue
()
!=
null
&&
attrClass
.
getValue
().
toString
().
equals
(
"[math]"
))
{
String
domid
=
"mw_"
+
CodeHelper
.
getRAMUniqueID
();
sb
.
append
(
"<span id=\""
).
append
(
domid
).
append
(
"\">"
);
renderStartHtmlTag
(
sb
,
component
,
resolvedAssessmentItem
,
span
,
null
);
span
.
getInlines
().
forEach
((
child
)
->
renderInline
(
renderer
,
sb
,
component
,
resolvedAssessmentItem
,
itemSessionState
,
child
,
ubu
,
translator
));
renderEndTag
(
sb
,
span
);
sb
.
append
(
"</span>"
)
.
append
(
"\n<script type='text/javascript'>\n/* <![CDATA[ */\n jQuery(function() {setTimeout(function() { BFormatter.formatLatexFormulas('"
).
append
(
domid
).
append
(
"');}, 100); }); \n/* ]]> */\n</script>"
);
}
else
{
renderStartHtmlTag
(
sb
,
component
,
resolvedAssessmentItem
,
span
,
null
);
span
.
getInlines
().
forEach
((
child
)
->
renderInline
(
renderer
,
sb
,
component
,
resolvedAssessmentItem
,
itemSessionState
,
child
,
ubu
,
translator
));
renderEndTag
(
sb
,
span
);
}
}
protected
final
void
renderObject
(
StringOutput
sb
,
Object
object
,
AssessmentObjectComponent
component
,
ResolvedAssessmentItem
resolvedAssessmentItem
)
{
Attribute
<?>
attrId
=
object
.
getAttributes
().
get
(
"id"
);
String
id
=
attrId
.
getValue
().
toString
();
if
(
id
.
startsWith
(
"olatFlashMovieViewer"
))
{
if
(
attrId
!=
null
&&
attrId
.
getValue
()
!=
null
&&
attrId
.
getValue
().
toString
().
startsWith
(
"olatFlashMovieViewer"
))
{
//this is a OpenOLAT movie and need to be converted
/*
<span id="olatFlashMovieViewer213060" class="olatFlashMovieViewer" style="display:block;border:solid 1px #000; width:320px; height:240px;">
...
...
@@ -569,7 +596,7 @@ public abstract class AssessmentObjectComponentRenderer extends DefaultComponent
// ]]></script>
</span>
*/
String
id
=
attrId
.
getValue
().
toString
();
Attribute
<?>
dataAttr
=
object
.
getAttributes
().
get
(
"data"
);
String
data
=
dataAttr
.
getValue
().
toString
();
Attribute
<?>
attrDataMovie
=
object
.
getAttributes
().
get
(
"data-oo-movie"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment