How to copy activities from one week to another?

How to copy activities from one week to another?

by Athail Pulino -
Number of replies: 61

I have an activity which is almost the same in everything but I need to put it on several weeks of my course.

Wish to copy it from one week to another and make a few changes.

Is it possible?

Thanks in advance.

Athail Pulino

Average of ratings: -
In reply to Athail Pulino

Re: How to copy activities from one week to another?

by Enrique Castro -
Picture of Core developers Picture of Particularly helpful Moodlers
Hi,
I think that there's no direct way, no "copy" button.

But, you can try this:
a) Create a mock course and there create an instance of the activity you need, with all settings. Put it in the first, generic, block of this empty course. Just give this instance a generic name: not the name you will be using in you course.
b) Create a backup file containing just this activity (by selecting the activity type, user data etc.)
c) restore this backup into your existing course (choose adding content, not overwriting)
d) edit the name of the activity and move it to the desired week

e) repeat c & d for as many weeks as you need

Hope that helps
- Enrique -

In reply to Enrique Castro

Re: How to copy activities from one week to another?

by Deb Burdick-Hinton -
Using version 1.8.2+ wondering if there has been any improvements in this area or if this is still the only way to copy sections.
Thanks
In reply to Deb Burdick-Hinton

Re: How to copy activities from one week to another?

by roel scheepens -

I can only confirm that the trick with changing "copy" to "duplicate" does not work for me in Moodle 1.9, either.

I am setting up a physics course with 16 topics, all of which will have a forum as well as a glossary for that topic (good idea from William Rice's book "Moodle Teaching Techniques", by the way).

For each forum and glossary I intend to change a few default settings, always in the same way.

I have done this 16x for the forums and I was hoping to avoid having to do it 16x for the glossary... so I fully sympathize...wink

In reply to Athail Pulino

Re: How to copy activities from one week to another?

by Ulf Jonsson -
Some versions agom the copy function was implemented as the caracter '2' beside all the other icons for modifying an activity. For some reasons this function was abandoned. But the copy function can be carried ou in the following way!

1. go to edit mode
2. point to the move up - dwn icon for the activity that you want to copy.
click right mouse button and copy the link address.
(example: http://....../moodle/course/mod.php?copy=172&sesskey=l5MpHsYv2S)
3. Now paste this link into the browser adress field and change the keyword
copy to duplicate! example:
http://....../moodle/course/mod.php?duplicate=172&sesskey=l5MpHsYv2S
4. copy/paste the new link address for multiple copies!
5. excute the modified link as many times as you as you want copies!
6. Move the newly created acitivites to the right positions(weeks, topics).
In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Ger Tielemans -

Would it be much work to:

  1. create a new icon for duplicate
  2. copy/rename the procedures behind the up/down button
  3. insert the new icon in the row in edit mode with the duplicate function
  4. (should duplicate instead of move..)

I was wondering...

  • In the sections there is also a move up move down button, so duplicate a complete section with all it's structure..  sad

 

In reply to Ger Tielemans

Re: How to copy activities from one week to another?

by Karrie V -

I agree, I would really like to see a duplicate icon - it would make my life 1000 times easier! I would also like to be able to duplicate an entire block as well. If I had a clue as to how to write code - I would attempt it but unfortunately code is not my forte!

In reply to Karrie V

Re: How to copy activities from one week to another?

by Ray Lawrence -
Karrie,

Create a new HTML block. Select, copy and paste the contents of an existing block into the HTML block. Save the changes.

Tried this on a few just now and it seems to work OK.

Ray
In reply to Ray Lawrence

Re: How to copy activities from one week to another?

by Karrie V -

I'm sorry, I should have said topic section - where the activities are thats what I want to copy.  I dont think this will do what I want....please say I'm wrong and it is as easy as you say.

In reply to Karrie V

Re: How to copy activities from one week to another?

by Ray Lawrence -
This won't work for topics only blocks.
In reply to Ray Lawrence

Re: How to copy activities from one week to another?

by Ger Tielemans -
Must be possible to read the content of one section from the database and then write it to the fields for the new section, isn.t it? (Only How??)
In reply to Karrie V

Re: How to copy activities from one week to another?

by Michael Pietrzak -
Absolutely -- copying individual items as well as full blocks is SORELY NEEDED!
In reply to Karrie V

Re: How to copy activities from one week to another?

by Michael Pietrzak -
Absolutely -- copying individual items as well as full blocks is SORELY NEEDED!
In reply to Karrie V

Re: How to copy activities from one week to another?

by Alice Keeler -
I wish I knew how to write code also. I finish my masters degree in October, I then plan to try to learn code to write for Moodle smile I am probably crazy!
In reply to Ger Tielemans

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
I just posted an entry under the library section that addresses this. The code in mod.php for duplicating a module type event (for example, as assignment, chat, etc) exists already and is currently commented out.

I have submitted an icon attached below which could be used.

I would like to see functionality added that would allow a popup list of the courses that someone teaches to be on the duplicated event page with the default being the current course. If a different course is selected then the event would be duplicated (i.e. copied) to the other course. That way a teacher having different sections of the same course would not have to duplicate their efforts and save a lot of time typing (especially on a longer assignment). Further, they would not have to go through the hassle of doing a backup/restore and running the risk of messing something up.

I think a few checks would need to be made to ensure a similarity between the courses so that for example an event from week 15 of one course does not try to be copied to a social course or a topic course with only 4 sections. But assuming a basic similarity between the courses this duplicate function should work.

I would be happy to work on the development of this. I'm new to coding so I would need someone to check it and make sure it conforms to the standards and is consistent with the rest of the code.
Attachment duplicate.gif
In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Tim Allen -
This is a clever tip which people can use until this feature is available, thanks a lot Ulf!  smile
In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Karrie V -

If it is that easy cant we make a icon for it?  Obviously the feature is already working.  I do this ALLLLLLLLLLLLLLL the time and it would really help if I didnt have to teach this method to my teachers. 

Thanks for saving me a LOT of time!

smile Karrie

In reply to Karrie V

Re: How to copy activities from one week to another?

by Karrie V -
Looks like I spoke too soon.  Worked on my old copy but does not seem to work on 1.5 and here I thought my life would be easier! sad
In reply to Ulf Jonsson

What reasons?

by Ne Nashev -
Do You know that reasons to abandon copying?
In reply to Ne Nashev

Re: Why abandon copy?

by Karrie V -
Sure wish I knew!  Can someone else check to see if it works with 1.5 - maybe its just me!
In reply to Karrie V

Re: Why abandon copy?

by Tim Allen -
On 1.5 alpha (2005051500), this copy tip still worked for me.

I can't check it on 1.5 final right now, sorry.

Tim.
In reply to Karrie V

Re: Why abandon copy?

by Art Lader -
The copy activity procedure works for me on 1.5.

-- Art
In reply to Art Lader

Re: Why abandon copy?

by D.I. von Briesen -
I'm in 1.52 in firefox and I see the copy URL, which is then quickly replaced by a new URL that jumps to the right place in the page. I tried a few experiments with multiple open windows and didn't get it to work.

I suppose you could write down the url (appears in status bar) or go thru the page src code and get it that way, but doesn't seem like worth the trouble when you actually could cut and paste (different story for activities, but suspect this doesn't work for those, since that would violate the OO concepts in moodle - changing location is just a label, not really changing DB entries of content).

However I have found that with labels (which I now use exclusively instead of topic/section descriptions) if you make a good one and copy it across all sections, it doesn't take long, and when you recopy yoru course it's done for you. By using labels, you can move them around more easily than section notes (which are irrevocably tied to everything in that section). So for example:

READING: Overview of CIW Foundations Exam 1D0-510, Introductions, course syllabus. Read first couple of sections of HTML tutorial on http://www.w3schools.com  and look up some of the key terms on Howstuffworks.com.  HOMEWORK/LABS: Forums A & B  QUIZZES: None this week  MISCELLANY: Get comfortable with elocker as part of Forum 1B. Memorize the basic shell of an html page (html, head, title, body, h and p tags). Be sure to answer the ARE YOU THERE? question. 
Is in each section, obviously with different black text (but the colored stuff in bullets is the same). Some have even a few more.

Now as far as copying other things (like forum and such) that would be a godsend, and I too would love to know when it might come (back?). I realize no two forums should be the same, but I've got 16 that are ALMOST the same (different name, slightly, but everything else identical). I suppose from a programming perspective, it comes down to knowing where all the fields relating to a given activity are located in the DB, then duplicating them, then making sure there's a "place" on the page... so it could get tricky.

Cheers,
d.i.
In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Karrie V -
Any chance of the copy icon coming back?  My teachers cant get the hang of changing the url.  smile
In reply to Karrie V

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
If you are interested, check out how I have hacked Moodle to duplicate assignments at http://www.arborrow.net/moodle (I apologize if the performance is slow as I am hosting it through a free host) - not only can a teacher duplicate the assignment within the course but also copy it to another course. I have implemented this at our high school and it seems to work reasonably well although I recognize that the code needs to be cleaned up.
In reply to Anthony Borrow

Re: How to copy activities from one week to another?

by Brian Gray -

This is interesting....I like the way it works.

What version of Moodle are you running this on?

I tried to duplicate a Workshop activity.  Most of the info copied as expected, but the grading scale/rubric info was not.  Any idea why?  Is it something I did (or did not do)?

bkg

In reply to Brian Gray

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers

It was done using 1.5.2+

The more complex the activity the less likely it is to work completely. For example quizzes will copy the quiz event itself but not the questions. I would need to do more work into duplicating the detail information and since I do not yet use workshops I did no testing with them. So it is not a matter of what you might have done - it is simply a matter of what I have not done (yet). Thanks for your feedback - I have been pleased with the implementation at our site. Peace - Anthony.

In reply to Anthony Borrow

Re: How to copy activities from one week to another?

by Brian Gray -
Anthony -

If/when you do work on the Workshop module to include the grading info, I would be happy to do some testing for you.

bkg

In reply to Anthony Borrow

Re: How to copy activities from one week to another?

by Matt Cromwell -
Anthony,
Thanks A LOT!!! I hope your wishes for further developing this feature comes true because that would improve it a lot. Nevertheless, even as it is I'm sure it saved me DAYS!!

I'm working on creating a course rubric for my faculty so that they can just plug in their info rather than having to create everything for each new class. I just created the lessons, discussions, and quizes once and then copied them to each new week.

Another improvement would be to not only place the copied module into the proper course, but also a specific week within that course. In this way it implements the "move" feature immediately rather than first copying, then also moving.

Anyway, thanks so much.
In reply to Matt Cromwell

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
My apologies for the delay - I have been swamped with a new semester getting underway. As I have the duplicate functionality implemented - it should copy an assignment, resource, label, etc. over to the new course and maintain it in the same week. 
In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Edward Hewlett -
1. go to edit mode
2. point to the move up - dwn icon for the activity that you want to copy.
click right mouse button and copy the link address.
(example: http://....../moodle/course/mod.php?copy=172&sesskey=l5MpHsYv2S)
3. Now paste this link into the browser adress field and change the keyword
copy to duplicate! example:
http://....../moodle/course/mod.php?duplicate=172&sesskey=l5MpHsYv2S
4. copy/paste the new link address for multiple copies!
5. excute the modified link as many times as you as you want copies!
6. Move the newly created acitivites to the right positions(weeks, topics).
Wow... This actually works (Moodle 1.6)! I still don't understand why this functionality has yet to be included in a simple button or something...
Average of ratings: Useful (1)
In reply to Edward Hewlett

Re: How to copy activities from one week to another?

by Art Lader -
Maybe we can get this into 1.8. Why not try to raise a little money to do that?

-- Art
In reply to Edward Hewlett

backing up foruns

by Alberto G. P. Oliveira -

Hi Ulf and Edward,

This is really interesting! I tried to do that for backing up a forun, but it didn't worked out.

I mean, it did work, but duplicated only the forun settings, without the topics (that is what I was really interested in).

But could solve the problem by following the instructions from Shailesh at this post, at this same forun.

Thanx a lot
Regards

In reply to Ulf Jonsson

Re: How to copy activities from one week to another?

by Deb Burdick-Hinton -
This does not appear to work for 1.8.2+
Anyone find a work around for that version.
I am with everyone else on this - this would make my life a little easier and save me a TON of time.
In reply to Deb Burdick-Hinton

Re: How to copy activities from one week to another?

by Melissa Benson -
Has anyone come up with a solution for duplicating activities and resources? I'm using version 1.9.1 . Thanks.
In reply to Melissa Benson

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Melissa - I recall some hidden code that implemented duplicate functionality back around Moodle 1.5 and 1.6. I believe that the idea was scrubbed at the time because of concerns on further complicating the user interface. Instead, the option of being able to import resources and activities from another course was chosen which uses the backup and restore functions. I created what I referred to as a Teacher Repository course for various subjects (for example, Spanish 1) that all teachers of that class could access and share resources and activities with one another. The idea was that they could then pull in those resources and activities using Import and move them where they would like in their course. Similarly, you could use another course (I believe I heard LSU was using a similar approach by giving each teacher a master course template) which they use to create new courses. So I think you could accomplish what you are hoping in terms of duplication with an import and move which I realize is not as convenient as a simple duplicate. Does that help? I would be interested in seeing more discussion about this if it is a feature that folks think would be helpful. Peace - Anthony
In reply to Anthony Borrow

Re: How to copy activities from one week to another?

by Melissa Benson -
Anthony,

That seems like a pretty good solution for a large amount of duplication or multiple duplicates for many teachers. However, to do all of that just for one teacher to duplicate a week or topic section for the second, third week or topic section seems a bit tedious. I am going to look into this more and see if there is a better solution. I'm thinking the backup/restore may be the only option as of now though. Thanks for your response.
In reply to Melissa Benson

Re: How to copy activities from one week to another?

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Melissa - It is a question that has been around for quite a while so any thoughts or creative ideas you can come up with would be welcome. Setting up a course for the first time can be tedious. The nice thing is that once it is setup they can continue to use it by resetting the course. If I were building a course and I knew that I wanted to have a particular set of forums or other activity every week I would probably start by creating the activities in my Repository course (a separate course where I hold all my resources and activities). I would then import into the actual course and move the topic in that class down to the bottom and then import again and just repeat the process until the course was good to go. Again, a bit repetitive but probably would save some time. Please let us know what other ideas you might come up with as we are always looking for ways to save time and effort and just make and do things better. Peace - Anthony
In reply to Anthony Borrow

Re: How to copy activities from one week to another?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
By the way, my colleague Alan Thompson just implemented a new module type that we call "Repeat activity". The idea is that suppose you have a wiki in week 1 of your course where the students are supposed to enter their aims for the course. Then in week 10, you want to tell them to go back to the same wiki, and update what they wrote before. Then you can do this:

1. In week 10, do "Add a resource ... -> Repeat activity".
2. In the editing form, choose the other activity you want to link to from a drop-down menu, and either enter a new bit of text to use as the link to the activity, or leave it blank to use the original name.

Of course, you can do the same thing by adding a label, and putting in the URL of the other activity, but that is not as nice, and you end up with the wrong icon.

We have only just released this (and, of course, the moment it was on the live servers, people found some bugs. Why couldn't they have found them before the release.) Anyway, if people are interested, we could probably get this into contrib.
In reply to Tim Hunt

Re: How to copy activities from one week to another?

by Art Lader -

This is great news, Tim. I look forward to the release of this module. I know that it will be very popular once it is available.

Thank you in advance for sharing!

-- Art

In reply to Melissa Benson

Re: How to copy activities from one week to another?

by Nicola Bennett -

Hi Melissa,

I've upgraded to 1.9.2 and have also discovered that the neat little trick of duplicating activities/resources doesn't work in this later version of Moodle.

This was an undocumented feature that I used all the time and will greatly miss as it saved lots of time and ensured consistency.

Have you or anyone else found a neat solution for this?

I just don't understand why this feature hasn't been incorporated into the latest version!

In reply to Nicola Bennett

Re: How to copy activities from one week to another?

by Kevin Oldham -
Has anyone found a resolution to this problem? I noticed that the duplicate feature works in modules that have the mod.html file with them. I suppose that these are older version modules because most the modules that are standard in 1.9 do not have these files.


In reply to Kevin Oldham

Re: How to copy activities from one week to another?

by Itamar Tzadok -
Recent discussions about this issue suggest (selective) export-import of the activity. smile
In reply to Itamar Tzadok

Re: How to copy activities from one week to another?

by Kevin Oldham -
I've read that too. Nevertheless, it does seem like a lot of clicking and file manipulation to perform what some of us feel could be a straight forward task. I'm just checking to see if anyone has successfully create a duplicate feature. Thanks for any suggest anyone might have.
In reply to Melissa Benson

Re: How to copy activities from one week to another?

by A. T. Wyatt -
Greetings, all!

You could vote for
http://tracker.moodle.org/browse/MDL-4487
and
http://tracker.moodle.org/browse/MDL-11288

Both these issues have to do with duplicating or copying activities. Something I would really love to have!

atw
In reply to A. T. Wyatt

Re: How to copy activities from one week to another?

by Nancy Webb -
Thanks, I voted too.  It's important!
In reply to A. T. Wyatt

Re: How to copy activities from one week to another?

by Clark Moodler -
Yes! more votes for A.T.'s duplicating and copying activities tickets!
Might be a possibility for GSOC?

csn




"You could vote for
http://tracker.moodle.org/browse/MDL-4487
and
http://tracker.moodle.org/browse/MDL-11288

Both these issues have to do with duplicating or copying activities. Something I would really love to have!

atw"
In reply to Athail Pulino

Re: How to copy activities from one week to another?

by Thomas Robb -
Here is a hack that places a duplicate icon in the icon row of each course element when editing is turned on.  Clicking on it then brings up the "update dialog".  Update the module and you will then have a new copy in the same location as the old one.  Then move it to the desired location.

As you have already observed, the functionality is already there.  All I have done is to create an icon that has "duplicate" instead of "move" in the URL string.

Here is the contents of the included README.txt file:

This assumes you are using Moodle version 1.5.4

To activate the Duplicate function do this:

1) rename the moodle/course/lib.php file to libgood.php so that you can replace it if need be.
2) place moodle/course/lib.php  with the lib.php file included herein
3) place the duplicate.gif file in moodle/pix/t

To undo the changes, simply remove the new moodle/course/lib.php file and replace it with the original one that you renamed libgood.php

WARNING:  THERE ARE MANY FILES CALLED LIB.PHP IN THE VARIOUS MOODLE FOLDERS.  BE SURE YOU REPLACE THE CORRECT ONE!!

For other versions, a similar hack can probably be made.  Search the lib.php file for "duplicate.gif" to see the code that has been hacked.
In reply to Thomas Robb

Re: How to copy activities from one week to another?

by Thomas Robb -
Here is another version that works with version 1.6.  To repeat from my last posting, this allows you to duplicate any activity, modify it and then move it elsewhere in your course.  It works just like the "Edit" icon except that when you are done, you have a second instance of the object in the same block as the original.  Please let me know if you have any problems with it.  
In reply to Thomas Robb

Re: How to copy activities from one week to another?

by Pablo Etcheverry -
Picture of Core developers
Hi, Thomas!

I just did a tiny change to your code, since when installed the "Move" word read when mousing over. Just replace this:

1742  '<a title="'.$str->move.'" href="'.$path.'/mod.php?duplicate='.$mod->id.

to this:


1742 '<a title="'.$str->duplicate.'" href="'.$path.'/mod.php?duplicate='.$mod->id.

...and that's all!

Sadly, it doesn't work on Book

Cheers,
Pablo
In reply to Pablo Etcheverry

Re: How to copy activities from one week to another?

by Joan Codina Filba -
Some of my students did a patch a year ago, you can try it to copy activities, this year some others did it using Ajax, but the code is not sill available (i hope it will be soon available)

In reply to Joan Codina Filba

Re: How to copy activities from one week to another?

by Ger Tielemans -

Will you ask your students for next year to create a button on the section card nwith the choices:

1. copy this section with it´s content in this course

2. copy this section to another course (choose from a list)

3. move it to an archiv (choose a course from a list on this moment)

harder one:

4. copy from archiv (on this moment: another course) to this course

 

 

In reply to Ger Tielemans

Re: How to copy activities from one week to another?

by Heleen Traas -

Is there a possibility that the copy-functionality will come soon?

I just started working with Moodle and this is the only thing really missing. The above options are a bit too far for my experience at the moment.

Heleen

In reply to Heleen Traas

Re: How to copy activities from one week to another?

by Timothy Takemoto -
Audun Hauge's Layout editor (downloadably here thanks to Bruno Vernier) allows copying as well as moving I think. I have not installed it yet this term but it worked like a dream last term - like Ajax except with copying.
In reply to Timothy Takemoto

Re: How to copy activities from one week to another?

by Ger Tielemans -
Don Hinkelman's new project format comes very close to the wished solution!
In reply to Athail Pulino

Ynt: How to copy activities from one week to another?

by Serkan Ozel -
I know this is an old topic. We are in 2011, and I have been seeking an answer for the same problem. I saw that there were several suggestions to achieve this goal. I would like to share one that I found useful. Sharing Cart is a block lets you duplicate (without user data) any item in one of your course within or among your courses. http://moodle.org/mod/data/view.php?d=13&rid=2150&filter=1 is the URL. I hope it helps.
In reply to Serkan Ozel

Re: Ynt: How to copy activities from one week to another?

by Stefan Nychka -

In 2.1, the functionality to copy at least an activity (hopefully a resource, too) within a course exists.  See the end of the discussion for a pointer to a still-open ticket to copy (or, maybe better put, share) activities and/or resources between courses.

Sorry if this is off-topic.  I admittedly skimmed much of this thread and the tracker issue, so of course no worries if someone posts a correction.