Adding additional settings

Adding additional settings

by Alexander K -
Number of replies: 0
Hi everyone!

I'm having a problem adding new settings on the form when you create a new assignment. I managed to add a few lists based on the already existing form elements of the plugin "Single Upload".

I did the following in ../assignment/type/PLUGINNAME/assignment.class.php

First I made a list of values I'm using for the select form:

$input = array(0 => "default", 1 => 0.10, 2 => 0.20, 3 => 0.30);

The form elements itself were made like this:

$mform->addElement('select', 'border1', get_string("plag1", "assignment_uploadplag"), $input);
$mform->setDefault('border1',0);

$mform->addElement('select', 'border2', get_string("plag2", "assignment_uploadplag"), $input);
$mform->setDefault('border2',0);

$mform->addElement('select', 'border3', get_string("plag3", "assignment_uploadplag"), $input);
$mform->setDefault('border3',0);

After creating the assignment, I'm trying to retrieve the information according to the guide here like this:

optional_param('border1, 0, PARAM_FLOAT);

But all I get is the default value of the form. I assume the set value was not saved correctly or not saved at all :/

I'm grateful for any help as I'm quite new to Moodle Development.

Regards
Average of ratings: -