[system] / trunk / pg / macros / source.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/source.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6853 - (download) (as text) (annotate)
Sat Jun 11 23:28:58 2011 UTC (8 years, 7 months ago) by gage
File size: 1454 byte(s)
added comments on how to set up source button.


    1 if ($displayMode =~ m/HTML/ && !defined($_slides_loaded)) {
    2   TEXT(
    3      '<DIV ID="source_button" STYLE="float:right; margin-right:2em">'
    4     .  '<SCRIPT>function showSource () {'
    5     .  '  window.open("'.$htmlURL."show-source.cgi/$probFileName".'","ww_source");'
    6     .  '}</SCRIPT>'
    7     .  '<INPUT TYPE="button" VALUE="Show Problem Source" ONCLICK="showSource()">'
    8     .'</DIV>'
    9   );
   10 }
   11 
   12 sub NoSourceButton {
   13 #  if ($displayMode =~ m/HTML/) {
   14 #    TEXT('<SCRIPT>document.getElementById("source_button").style.display = "none"</SCRIPT>');
   15 #  }
   16 }
   17 
   18 
   19 =head3   sourceButton
   20 
   21 ########################
   22 # activating the source button
   23 ########################
   24 
   25 # In order for this button to work the course needs to have a link from
   26 
   27 #   myCourse/html/show-source.cgi   back to webwork2/htdocs/show-source.cgi
   28 
   29 #   in the directory myCourse/html
   30 #   execute the following command (you will need command line access to the server to do this)
   31 #   ln -s /opt/webwork/webwork2/htdocs/show-source.cgi    show-source.cgi
   32 #
   33 #   You need to make sure that the file webwork2/htdocs/show-source.cgi is executable by the
   34 #   apache webserver.
   35 #
   36 #   To accomplish this you need to uncomment this line in webwork.apache2-config
   37 #
   38 #   ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2
   39 #
   40 #
   41 #   The show-source.cgi script may also have to be customized to set $root to the webwork2 directory
   42 
   43 
   44 
   45 =cut
   46 
   47 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9