WeBWorK Problems

Link to local pdf

Re: Link to local pdf

by Alex Jordan -
Number of replies: 0

Danny's code works for when `file.pdf` is in the same directory as the pg file, as OP describes.

An alternative that is better in some (not all!) situations, is to put the file in the course's html/ folder. That folder is parallel to templates/, so you navigate up one level in the File Manager to get there.

And then replace `alias('file.pdf')` with:
`alias("${htmlDirectory}file.pdf")`

And if you really want to hard code a link to that file in one specific course's html/ folder, then replaceĀ  `alias('file.pdf')` with:
`'https://webwork.myschool.edu/webwork2_course_files/mycourse/file.pdf'`
where `myschool` and `mycourse` are edited appropriately.

To decide what is best, think about the consequences of how the .pg file is coded, and what will happen if it propagates to other courses.