Bug #7079

Improve course copy for assignments

Added by Yannick Warnier about 7 years ago. Updated almost 7 years ago.

Needs more info
Assignments / Work
Target version:
Start date:
Due date:
% Done:


Estimated time:
SCRUM pts - complexity:


The copy of assignments now works, but it is still flawed in several ways:
  • the copy only works the first time: if you copy the task once, then delete the task in the destination course, it is impossible to copy again (must be something to do with the folder still being there)
  • the copy of dates is imperfect. For a course with submission dates being 2014-04-17 23:59:00 and 2014-04-24 23:59 in the original, I get a copy with 2014-04-18 04:59 and 2014-04-25 04:59 (I'm at GMT-5, so that's something to do with timezones and not using api_get_utc_datetime() properly)
  • somehow, function function restore_student_publication() checks the original table for info about the assignment, which should NEVER be the case for any resource copy, as it might be copied from one portal to another portal, without database link

The current status is not good, but it is already better than not copying the task at all.

Use this commit for reference of what code needs to be looked into:



Updated by Julio Montoya about 7 years ago

The function "restore_student_publication" is deprecated it should not be used.


Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Yoselyn Castillo to Yannick Warnier

I have tried in 1.9.8 I have created a course
Into the course, I have created a new assignment with a deadline time, Later I have copied the course into course2 and course3. Assignment was successfully copied twice and dates are successfully shown.

So, i think this is fixed, is any other bug related to this?

Also available in: Atom PDF