Difference between revisions of "StaticImages"
(added historical tag and gave updated problem link) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/problem-techniques/StaticImages.html a newer version of this problem]</p> |
||
<h2>Static Graphic Images: PG Code Snippet</h2> |
<h2>Static Graphic Images: PG Code Snippet</h2> |
||
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
− | <em>This code snippet shows the essential PG code to insert a static (pre-generated) graphic image into a problem. Note that these are <b>insertions</b>, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.</em> |
||
+ | <em>The instructions below seem out-of-date. See discussion using [@ ... @]* in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=3287 which works. |
||
+ | |||
+ | OLD: |
||
+ | This code snippet shows the essential PG code to insert a static (pre-generated) graphic image into a problem. Note that these are <b>insertions</b>, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.</em> |
||
</p> |
</p> |
||
<p style="text-align:center;"> |
<p style="text-align:center;"> |
Latest revision as of 09:48, 29 June 2023
This problem has been replaced with a newer version of this problem
Static Graphic Images: PG Code Snippet
The instructions below seem out-of-date. See discussion using [@ ... @]* in https://webwork.maa.org/moodle/mod/forum/discuss.php?d=3287 which works. OLD: This code snippet shows the essential PG code to insert a static (pre-generated) graphic image into a problem. Note that these are insertions, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.
PG problem file | Explanation |
---|---|
BEGIN_TEXT \{ image( "imagename.png" ) \} \{ image( "imagename.png", width=>150, height=>150, tex_size=>700, extra_html_tags=>'alt="Graph of a function."' ) \} END_TEXT |
Here it's easy: we just use the
For each PG problem with static images, you should put both the PG file and the image files into their own separate subdirectory. This subdirectory should be located somewhere under the course
We should always, of course, include options such as specifying the (When the alias() command in dangerousMacros.pl is rewritten in the future, support for JPG, PDF, and SWF files should become available.) |