## PREP 2015 Question Authoring - Archived

### Importing files from webwork 2.9 to webwork 2.10

by tim Payer -
Number of replies: 3

Hello!

I am having trouble importing files from webwork 2.9 into webwork 2.10 (in the form of our PREP 2015 course) Do you think you could find out where my mistake is in either of these approaches ( A vs B,  below)? Next week I plan to open a 2.10 webwork course on the MAA server and want to be sure of the process of moving files into new 2.10 version.

I have listed each step to help point out where the glitch might be:

Approach A:  The intention is to move two HW sets (named "setM105_HWK_5.def" and "setM105_HWK__4.def") from a 2.9 webwork course into an empty HW set called "Payer_Trial_set" within our PREP2015 course.

1. Select both HW sets (named "setM105_HWK_5.def" and "setM105_HWK__4.def") under the templates directory within the File Manager of WW 2.9.

2. Click on "Make Archive".

3. Select the newly formed "january_2015_Files.tgz" and click on Rename to name the file: "HW_def_files_4_5.tgz" just to discriminate between the multiple attempts of this process.

6. Open our PREP 2015 course and create a new empty HW set called "Payer_Trial_set".

7. Open the templates directory under File Manager within the PREP2015 course and click on Choose File.

8. Open with a double click the compressed file of "HW_def_files_4_5.tgz" from its folder within my computer.

10. The file unpacks nicely within the template directory of the File Manager and reveals the contents of the two set files: "setM105_HWK_5.def" and "setM105_HWK__4.def".

11. Open the Hmwk Sets Editor 2 within the PREP2015 course.

12. Click on the import tab and select the empty HW set of "Payer_Trial_set".

13. Choose multiple sets from the pull down menu and select both sets from the next pull down menu of "setM105_HWK_5.def" and "setM105_HWK__4.def".

14. Assign these sets only to Payer (myself) and Click on Take Action.

"The results of the last action performed" report in a green field that:

0 sets added, 2 sets skipped. Skipped sets:(M105_HWK_5, M105_HWK__4)

So it is not an error statement. It is just that the sets are not getting imported. Can you see any glitch I made here that would have caused this?

Approach B:

An alternate approach shown here uses group folders for homework sets and and their associated newly created HW problems. For Example a new folder is opened in the templates directory under the File Manager of WW 2.9 with the name M105_HW_19_2015. The contents of this folder is the file of "setHW__19.def file" and 5 or 6 *.pg files created for HW 19.

The point here was just to create some order on the multitude of files that are created. But this approach faired no better:

1. Select all HW folders relevant to the course under the templates directory within the File Manager WW 2.9.

2. Click on "Make Archive".

3. Select the newly formed "january_2015_Files.tgz" and click on Rename to name the file: "July_7_2015_M105_WW_Files.tgz" just to discriminate between the multiple attempts of this process.

6. Open our PREP 2015 course and create a new empty HW set called "Payer_Trial_set". (Already completed in prior steps)

7. Open the templates directory under File Manager within the PREP2015 course and click on Choose File.

8. Open with a double click the compressed file of "July_7_2015_M105_WW_Files.tgz" from its folder within my computer.

10. The file unpacks nicely within the template directory of the File Manager and reveals all the folders selected. However to see the contents of each folder, each folder must be opened individually.

11. Open the Hmwk Sets Editor 2 within the PREP2015 course.

12. Click on the import tab and select the empty HW set of "Payer_Trial_set".

13. Choose multiple sets from the pull down menu.

14. OH-OH! Not a single folder is NOT visible from the pull down menu!

Does this necessarily mean that combining HW sets with their respective *.pg files is not a good idea because the the HW set editor cant find a folder, only a file? Or is there a fix for what i have done here. I can pull the contents from each folder with a lot of affixing  of ../in a renaming of each file, but I thought that this was ordering the numerous files in a way to make them all manageable.

Any thoughts on how to keep it all ordered?

Lastly a general question about the storage of HW set files and *.pg files:

Is it better to keep both stored in the local directory or the template directory?

Thank you so much for your help on these points.

Tim

### Re: Importing files from webwork 2.9 to webwork 2.10

by Davide Cervone -
For approach A, I suspect that the problem was that the two homework sets already existed (from previous attempts at this). At least there were sets with this name already in the course when I looked. I deleted the sets and followed your outline again, and had no trouble. Doing it when the sets existed did produce the same results was you. I have left the sets deleted so that you can go throughout he process again yourself successfully. (I don't know what steps 6 and 12 are supposed to do, however, as the sets will be imported as new sets with names taken from the set definition file names. The homework set selected by checkbox in the list of existing homework sets will have no effect.)

Note that your process A will be only successful if the sets include only problems from the OPL, and not any locally modified or created files. This is true of M105_HWK___4 but not of M105_HWK_5, which contains a locally modified file. So you would need to move that .pg file as well before that homework set will be fully functional.

As for process B, it turns out that the set definition files (.def files) must be in the top level of the templates directory, not in a subdirectory, in order to be available in the Homework Sets editor. So you would need to move (or copy) them from your subdirectories into the main templates directory first. Again, steps 6 and 12 are unnecessary.

### Re: Importing files from webwork 2.9 to webwork 2.10

by tim Payer -
Thank you Davide!

I will set it right.

Should I take from this that most of my set files and problem files should be made, created, and stored in the templates directory? and not the local directory?

Thanks...
No. I would still put the .pg files in subdirectories to help categorize the problems you are writing. Only the .def files need to be in top of the templates directory.