General developer forum

How do I ask in php which radio button has been selected- Moodle 3.0

 
este soy yo modlers
How do I ask in php which radio button has been selected- Moodle 3.0
 

Hello community, I am using moodle 3.0 and I want to ask in mod_form.php which of the radiobuttons that engo was selected and how I captured the value and the id or all properties of the radiobutton?

Thanks for everything
This is what I have done
$dataId = array();
$i = 0;

$mform->addElement('header', 'fmfieldset', 'Busqueda por defecto');

$radio_group=array();

foreach ($resultados as $object) {

$datos = $object->getDoc();

$dataId[$i] = $datos['id'];

$i++;

$radio_group[$i] =& $mform->createElement('radio', 'ratingtime', "", "Datos: autor=" . $datos['autor_t'] . " descripcion=" . $datos['descripcion_t'] . " id=" . $datos['id'] . " titulo=" . $datos['titulo_t'] . "<br>");

}

$mform->addGroup($radio_group, 'radio_group', 'Objeto a Añadir', ' ', false);

$mform->disabledIf('radio_group', 'radionabled');
$radio_selected = null;
$id_necesario = null;
foreach ($radio_group as $radiobutton){
if ($radiobutton['checked']=='checked'){
$radio_selected = $radiobutton;
$id_necesario = $dataId[$radio_selected['id']];
}
}
echo $radio_selected . $radiobutton. $id_necesario;


 
Average of ratings: -