* YUI form submittion does not support two submit buttons this is a workaround.
      */
     $tugcancelledfield = optional_param('_intuitel_TUG_cancel', null, PARAM_ALPHA);
     if ($tugcancelledfield !== '') {
         // The browser use Javascript.
         if ($tugcancelledfield === 'true') {
             $_REQUEST['_intuitel_user_intent'] = 'cancel';
         } else {
             $_REQUEST['_intuitel_user_intent'] = 'submit';
         }
     }
     // JPC: end of workaround for YUI bug with forms.
     if ($_REQUEST['_intuitel_user_intent'] === 'submit') {
         // Ignore cancellation of the TUG messages.
         // TODO: Avoid sending this form in the User Interface but find a way to work without javascript too.
         $message = IntuitelController::ProcessTUGResponse($USER->id, $_REQUEST, $courseid);
         $log->LogDebug("LMS sends TUG answer: {$message}");
         block_intuitel_submit_to_intuitel($message);
     } else {
         $mid = required_param('mId', PARAM_ALPHANUMEXT);
         Intuitel::getAdaptorInstance()->logTugDismiss($courseid, $USER->id, $mid, 'DISMISS mId=' . $mid);
     }
 } else {
     if ($action == 'GEOLOCATION') {
         require_login();
         session_write_close();
         // Release the session to avoid block requests while waiting intuitel response.
         $adaptor = Intuitel::getAdaptorInstance();
         // Location.
         $lat = required_param('lat', PARAM_FLOAT);
         $lon = required_param('lon', PARAM_FLOAT);