/**
  * Delete a stored result
  * @param SimpleXMLElement $request
  */
 protected function deleteResult($request)
 {
     $this->result->result = null;
     $this->result->save();
     require_once $this->plugin_path . '/classes/class.ilExternalContentLPStatus.php';
     $lp_status = ilExternalContentLPStatus::LP_STATUS_IN_PROGRESS_NUM;
     $lp_percentage = 0;
     ilExternalContentLPStatus::trackResult($this->result->usr_id, $this->result->obj_id, $lp_status, $lp_percentage);
     $code = "success";
     $severity = "status";
     $response = $this->loadResponse('deleteResult.xml');
     $response = str_replace('{message_id}', md5(rand(0, 999999999)), $response);
     $response = str_replace('{message_ref_id}', $this->message_ref_id, $response);
     $response = str_replace('{operation}', $this->operation, $response);
     $response = str_replace('{code}', $code, $response);
     $response = str_replace('{severity}', $severity, $response);
     header('Content-type: application/xml');
     echo $response;
 }
 /**
  * Track access for learning progress
  */
 public function trackAccess()
 {
     global $ilUser;
     // track access for learning progress
     if ($ilUser->getId() != ANONYMOUS_USER_ID and $this->getLPMode() == self::LP_ACTIVE) {
         $this->plugin->includeClass('class.ilExternalContentLPStatus.php');
         ilExternalContentLPStatus::trackAccess($ilUser->getId(), $this->getId(), $this->getRefId());
     }
 }