original_string: protected function send_response($mod) {
          global $OUTPUT, $PAGE;
  
          $resp = new stdClass();
          $resp->error = self::ERROR_OK;
          $resp->elementid = 'module-' . $mod->id;
  
          $courserenderer = $PAGE->get_renderer('core', 'course');
          $completioninfo = new completion_info($this->course);
          $info = get_fast_modinfo($this->course);
          $sr = null;
          $modulehtml = $courserenderer->course_section_cm($this->course, $completioninfo,
                  $mod, null, array());
          $resp->fullcontent = $courserenderer->course_section_cm_list_item($this->course, $completioninfo, $mod, $sr);
  
          echo $OUTPUT->header();
          echo json_encode($resp);
          die();
      }
code: protected function send_response($mod) {
          global $OUTPUT, $PAGE;
  
          $resp = new stdClass();
          $resp->error = self::ERROR_OK;
          $resp->elementid = 'module-' . $mod->id;
  
          $courserenderer = $PAGE->get_renderer('core', 'course');
          $completioninfo = new completion_info($this->course);
          $info = get_fast_modinfo($this->course);
          $sr = null;
          $modulehtml = $courserenderer->course_section_cm($this->course, $completioninfo,
                  $mod, null, array());
          $resp->fullcontent = $courserenderer->course_section_cm_list_item($this->course, $completioninfo, $mod, $sr);
  
          echo $OUTPUT->header();
          echo json_encode($resp);
          die();
      }
code_tokens: protected function send_response ( $ mod ) { global $ OUTPUT , $ PAGE ; $ resp = new stdClass ( ) ; $ resp -> error = self :: ERROR_OK ; $ resp -> elementid = 'module-' . $ mod -> id ; $ courserenderer = $ PAGE -> get_renderer ( 'core' , 'course' ) ; $ completioninfo = new completion_info ( $ this -> course ) ; $ info = get_fast_modinfo ( $ this -> course ) ; $ sr = null ; $ modulehtml = $ courserenderer -> course_section_cm ( $ this -> course , $ completioninfo , $ mod , null , array ( ) ) ; $ resp -> fullcontent = $ courserenderer -> course_section_cm_list_item ( $ this -> course , $ completioninfo , $ mod , $ sr ) ; echo $ OUTPUT -> header ( ) ; echo json_encode ( $ resp ) ; die ( ) ; }
docstring: Send the details of the newly created activity back to the client browser
  
  @param cm_info $mod details of the mod just created
docstring_tokens: Send the details of the newly created activity back to the client browser