Difference between revisions of "IframeEmbedding1"
Jump to navigation
Jump to search
Paultpearson (talk | contribs) m |
Paultpearson (talk | contribs) (Add link to PGML version in OPL) |
||
Line 6: | Line 6: | ||
</p> |
</p> |
||
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/IframeEmbedding1.pg FortLewis/Authoring/Templates/Misc/IframeEmbedding1.pg] |
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/IframeEmbedding1.pg FortLewis/Authoring/Templates/Misc/IframeEmbedding1.pg] |
||
+ | * PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/IframeEmbedding1_PGML.pg FortLewis/Authoring/Templates/Misc/IframeEmbedding1_PGML.pg] |
||
<br clear="all" /> |
<br clear="all" /> |
Revision as of 21:18, 7 June 2015
HTML iframe Embedded Content
This PG code shows how to embed content such as a Google slide show or a YouTube video using an iframe
in html.
- File location in OPL: FortLewis/Authoring/Templates/Misc/IframeEmbedding1.pg
- PGML location in OPL: FortLewis/Authoring/Templates/Misc/IframeEmbedding1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "PGcourse.pl", ); TEXT(beginproblem()); |
Initialization: |
Context("Numeric"); $slideshow = MODES( HTML=> "<iframe src='https://docs.google.com/presentation/d/1pk0FxsamBuZsVh1WGGmHGEb5AlfC68KUlz7zRRIYAUg/embed#slide=id.i0' frameborder='0' width='555' height='451'></iframe>", TeX => "An embedded Google slide show." ); $video = MODES( HTML=> '<iframe width="420" height="315" src="//www.youtube.com/embed/NpDXXjClErk" frameborder="0" allowfullscreen></iframe>', TeX => "An embedded YouTube video." ); |
Setup:
We create a mode dependent variable |
Context()->texStrings; BEGIN_TEXT ${BCENTER} $slideshow $BR Google slides embedded using an iframe. $BR $BR $video $BR YouTube video of Arthur Benjamin, mathemagician, embedded using an iframe. $BR If the video does not work, \{ htmlLink("http://www.youtube.com/embed/NpDXXjClErk", "click here to go to YouTube directly.") \} ${ECENTER} END_TEXT Context()->normalStrings; |
Main Text:
Include the |
$showPartialCorrectAnswers = 1; |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |