original_string: public function close_attempt_popup($url, $message = '') {
          $output = '';
          $output .= $this->header();
          $output .= $this->box_start();
  
          if ($message) {
              $output .= html_writer::tag('p', $message);
              $output .= html_writer::tag('p', get_string('windowclosing', 'quiz'));
              $delay = 5;
          } else {
              $output .= html_writer::tag('p', get_string('pleaseclose', 'quiz'));
              $delay = 0;
          }
          $this->page->requires->js_init_call('M.mod_quiz.secure_window.close',
                  array($url, $delay), false, quiz_get_js_module());
  
          $output .= $this->box_end();
          $output .= $this->footer();
          return $output;
      }
code: public function close_attempt_popup($url, $message = '') {
          $output = '';
          $output .= $this->header();
          $output .= $this->box_start();
  
          if ($message) {
              $output .= html_writer::tag('p', $message);
              $output .= html_writer::tag('p', get_string('windowclosing', 'quiz'));
              $delay = 5;
          } else {
              $output .= html_writer::tag('p', get_string('pleaseclose', 'quiz'));
              $delay = 0;
          }
          $this->page->requires->js_init_call('M.mod_quiz.secure_window.close',
                  array($url, $delay), false, quiz_get_js_module());
  
          $output .= $this->box_end();
          $output .= $this->footer();
          return $output;
      }
code_tokens: public function close_attempt_popup ( $ url , $ message = '' ) { $ output = '' ; $ output .= $ this -> header ( ) ; $ output .= $ this -> box_start ( ) ; if ( $ message ) { $ output .= html_writer :: tag ( 'p' , $ message ) ; $ output .= html_writer :: tag ( 'p' , get_string ( 'windowclosing' , 'quiz' ) ) ; $ delay = 5 ; } else { $ output .= html_writer :: tag ( 'p' , get_string ( 'pleaseclose' , 'quiz' ) ) ; $ delay = 0 ; } $ this -> page -> requires -> js_init_call ( 'M.mod_quiz.secure_window.close' , array ( $ url , $ delay ) , false , quiz_get_js_module ( ) ) ; $ output .= $ this -> box_end ( ) ; $ output .= $ this -> footer ( ) ; return $ output ; }
docstring: Output a page with an optional message, and JavaScript code to close the
  current window and redirect the parent window to a new URL.
  @param moodle_url $url the URL to redirect the parent window to.
  @param string $message message to display before closing the window. (optional)
  @return string HTML to output.
docstring_tokens: Output a page with an optional message and JavaScript code to close the current window and redirect the parent window to a new URL .