Are attachments depended on initialization?

Are attachments depended on initialization?

by Eduard Moser -
Number of replies: 0

Hello everyone, 

I'm coding on a question type plugin which includes the opportunity for a teacher to add files (.pdf) in the $mform via addElement filemanager which will be visible for the students test. This also works like it should:

Now I'm facing the issue that after I copy the course, which includes this kind of question type, the icon is no longer visible. Although the data was correclty stored in the Database (via backup/restore) and the attachment is still visible in the question settings:

attachment question type settings

As soon as I hit "save changes" the attachment will be again visible in the test.

I'm thinking that it may has something to do with the data not been  preprocessed yet (data_preprocessing()). Which brings me to think that it is actually not possible to copy a course with an attachment (.pdf) to an extend that it would work right out of the box. Does anyone has something similar experienced? 

I can't sadly post my code here but I thought that it might be a known issue that I'm not aware of yet.

Thanks beforehand!

Eduard





Average of ratings: -