WeBWorK Main Forum

copy contents from one course to another

copy contents from one course to another

by Quoc Nguyen -
Number of replies: 4
Hello All,

I would like to copy all contents(home works, exams) from MATH100 to MATH101, which is just created. Do you know how to do it?

Thanks very much,
Q

In reply to Quoc Nguyen

Re: copy contents from one course to another

by Arnold Pizer -
The easiest way is when adding a new course to "Copy templates from:" the old course, not from the modelcourse. However, for this to work, you first have to Export all the sets before adding the new course since what you are really copying are things in the templates directory, e.g. set definition files, links, etc. You want to make sure the set definition files are current before copying them.

In the old course (Math100) goto Hmwk Sets Editor, check Export and select the sets you want to export (probably all) and click "Take Action!". This creates what we call set definition files which have the assignment name, assignments dates, and problems. The set definition file name is taken from the assignment name, e.g. sets 3 and test2 result in set3.def and settest2.def. These set definition files reside in the templates directory of your old course.

If at this point you add the new course and copy stuff from Math100 instead of the default modelcourse, all the set definition files will be automatically transfered to the new course. If Math101 already exists, then you have to transfer the set definition files to the templates directory of Math101. You can use the File Manager for this.

Then in the new course (Math101) goto Hmwk Sets Editor, check Import, multiple sets, select the sets you want to import, assign to all (or no) students and click "Take Action!". After that you will have to edit the assignment dates.

Note that if you transfered the set definition files by hand, you may also have to transfer any .pg files that are directly under the Math100/templates/ directory. Usually all the .pg problems are in a common area (e.g. in one of the problem libraries) and are simply linked to from a course's templates directory. If Math100 and Math101 are set up the same way with the same links, everything will work fine. If not or if Math100 uses .pg files that are not in a library location, you have more work to do since WeBWorK always assumes that the path to a .pg problem starts in the templates directory of the current course.

The bottom line is that by far the easiest thing to do is (1) Export all the sets in Math100 so that the set definition files are all current and then (2) add Math101 where you "Copy templates from:" the old course, not from the modelcourse.




In reply to Quoc Nguyen

Re: copy contents from one course to another

by Raghu Gompa -
Dear Q, this is what I do (there may be a simpler way):

  1. Go to file manager.
  2. Select all the files and folders that you want to copy.
  3. Press make archive.
  4. A file called MATH100.tgz (for example) will be created.
  5. Download this file to your local hard drive by selecting this file and pressing Download.
  6. Go to the other course, go to the file manager, and upload MATH100.tgz. Make sure you select Unpack archives automatically then delete them.
  7. This should copy all the files and folders (and its contents) in the new course.
Hope this helps.

Raghu
In reply to Quoc Nguyen

Re: copy contents from one course to another

by Brian Camp -
Hi Q,

I see you got some responses already. Here is what I do just about every quarter from the web interface.

1. go to the admin course
2. select "add course"
3. under the option "copy templates from" pick the course you are copying content from

***
now your course is created but the homework sets don't show up yet. You need to export the sets from the course you just copied.
***

4. select "export database"
5. pick the course to export from and then check at least the boxes that say "problem" and "set" (you can probably just select them all but you may see some warnings)
6. select "import database"
7. select the course you just exported from (it should be the only option to pick) and then select the course you are importing into

***
The homework sets should now be there.

If you already created the course but didn't base it upon the templates from the right course, it is still possible to copy material but it is more tedious. I would recommend copying the template material when the course is created.

Brian