title: Moodle Create Radio buttons group
body: <p>I am new to moodle. This is a very basic question , i have searched a lot but not able to correctly create a group of radiobuttons. I have not created radio buttons so far in moodle forms earlier.</p>
  
  <p>I want two radio buttons,with labels "award" and "deduct", in a local plugin i am creating.</p>
  
  <p>Code i wrote :</p>
  
  <pre><code>$awardingTypeRadioArr = array();
  $awardingTypeRadioArr[0] = $mform-&gt;createElement( 'radio','award','',get_string('clAwardRadioLbl','local_hps'));
  $awardingTypeRadioArr[1] = $mform-&gt;createElement( 'radio','award','',get_string('clDeductRadioLbl','local_hps'));
  $mform-&gt;addGroup( $awardingTypeRadioArr,'awardingType' );
  </code></pre>
  
  <p>I get the radio buttons and labels, but the second of the two is checked by default. Bigger problem is,I am not getting anything for the radio buttons in the form data.</p>
  
  <p>Please clarify how to do this.
  Thanks.</p>