Assignment

 
 
Picture of Chester Folming
Assignment defaults, not in mod_form(?)
 

I need to make the following changes for all new assignments:

  1. Cut-off date should be ticked off by default.
  2. Online text should be set to Yes by default, so that both Online text and File submission should be possible.
  3. Maximum number of uploaded files should be 5 as default.

Everything else I managed in mod/assign/mod_form.php

Where can I find these other settings?

(I am aware that after update I will have to repeat this, I have a simple system for that)

 
Average of ratings: -
Picture of Chester Folming
Re: Assignment defaults, not in mod_form(?)
 

I am sure somebody knows the answer to where the settings outside mod/assign/mod_form are placed.

Anyone?

 
Average of ratings: -
Me!
Re: Assignment defaults, not in mod_form(?)
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Chester,

1. Cut off date is in that form. 

2. You can set defaults for the plugin types in the admin interface - you don't need to change the code. See "Site administration -> Plugins -> Assignment Plugins -> Submission Plugins"

3. That is set in the form for that submission plugin "mod/assign/submission/file/locallib.php".

I am also working on a feature for 2.5 which will add default settings for everything at the admin level.

Regards, Damyon

 
Average of ratings:Useful (1)
Picture of Chester Folming
Re: Assignment defaults, not in mod_form(?)
 

Hi Damyon

Thank you a lot, 2) and 3) done.

In regard to 1) I knew Cut-off date was in the mod_form (I was a little unprecise in my question)

        $mform->addElement('date_time_selector', 'cutoffdate', get_string('cutoffdate', 'assign'), array('optional'=>true));
        $mform->addHelpButton('cutoffdate', 'cutoffdate', 'assign');
        $mform->setDefault('cutoffdate', time()+7*24*3600);

However I am in doubt, what I should write in this part - to keep the option, but have it deselected: array('optional'=>true)

 
Average of ratings: -
Me!
Re: Assignment defaults, not in mod_form(?)
Group DevelopersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

If you set the default to 0 it will be deselected. 

Hope this helps - Damyon

 
Average of ratings: -