Thanks for your reply Daniele,
So here is a couple of key questions for you.
1.) If you have created a directory for each homework assignment (I too followed this path but have since changed my mind about it) didn't you also have to change the file path to these HW set problems within the HW sets Editor?
I too did this and liked the organization of the file structure, that is until i tried moving the course to another webwork site....
2.) Have you tried moving the course you have created (just to practice) to another webwork site?
I was working with webwork version 2.9 and just for practice I tried moving a few of those sub-directories (using the same format you just described) over to our PREP 2015 course version 2.10. Loading the *.tgz of these sub-directories over to the 2.10 File manager they unzipped without any problem. The problem was that when I went to the HW Editor to import one or two of the HW sets into our PREP 2015 course, the files were not visible.
To make the loading of the HW set work I had to go back to the file manager, and unload the contents of the sub-directory by affixing a "../" to rename of each definition file. And then re-attempt to import the HW sets using the Homework set editor. This worked, but it is too laborious.
According to Davide Cervone's reply on my failed attempt he wrote that the sub-directories holding HW set files wont be visible to HW set Editor. Each HW set definition file must be stored as is in the templates directory in order for the HW sets Editor to "see" them and allow us to import them to a new webwork site.
Because of this I have elected to use a rigid naming convention and let the alphabetical ordering of the files within the templates directory help keep the files straight for me.
But I am far from certain that this is the "Best Practice"...And would like to hear of a better way if possible.
Not if your set definition file points to the subdirectories that you are using. As Daniele points out, if you create the set using the Library Browser, your set will have files that point to the subdirectories you created. Then if you save the set definition file using the HW set editor, it will contain references to the subdirectories. If you mob the set definition files and the subdirectories using an archive file, you will be able to move the sets from machine to machine without having to change anything (provided you keep the directory structure exactly the same in the new course templates directory).
the sub-directories holding HW set files wont be visible to HW set Editor. Each HW set definition file must be stored as is in the templates directory in order for the HW sets Editor to "see" them
This is correct. But if your directories are storing a complete homework, I would still move a copy of the set definition file into that directory so that you have all the needed pieces in one location. When you move the directory to the new machine, you would unpack the directory and move a copy of the set definition file to the top of the templates directory. It's an extra step, but it makes it more likely that you won't forget the
.def file later on when you move the directory.
Because of this I have elected to use a rigid naming convention and let the alphabetical ordering of the files within the templates directory help keep the files straight for me
I think you will find that to be harder in the long run.
That is if I archive the course from the template directory will that necessarily include an archive the local directory that the template directory holds? Or would I have to archive the local directory and then upload it in the new site separately?
- If you want to include homework sets, make sure that they are exported via the Homework Sets Editor
- Go to the file manager, and highlight everything you want to back up/migrate (all pg files, def files and subdirectories). You can highlight multiple files by holding down control in windows or command on a mac while you click. Once everything you want is selected, click the "Make Archive" button. This will create a [yourcoursename].tgz file, which you can download to your computer.
- This tgz file is an archive of all the files you selected. In mac or linux, you can browse it natively. On a pc you will need some sort of zip software (I think 7zip handles tar, gzipped files). Alternatively, if you just want to move things to another WeBWorK course, you can upload the .tgz file to the new course, and the File Manager will automatically expand the archive and put things in the right place.