Extra fields of an assignment type

Extra fields of an assignment type

Ilya Minkin -
回帖数:0
Hi everybody! I'm developing a new assignment type for my school. And I need to add some extra fields to the settings form of my assignment type. I found this interesting article: http://docs.moodle.org/en/Development:Assignment_types.

"You may find that to add extra items to the settings form for your plugin, that you need to find out the courseid or the assignmentid of the assignment you are editing. This information is not provided directly to the 'setup_elements' function that is used for this purpose."

What does this mean? How could I find out how to add extra items to the settings form? I read source of the "uploadsingle" type. Method setup_elements contains only form definition, and other methods retrieve information with such code: "$this->assignment->some_custom_field". I tried do it in such manner, but it doesn't work - data from settings form is unavailable in the instances of my assignment class. Why?