original_string: public static function rewrite_answers_urls($answer, $rewriteanswer = true) {
          global $PAGE;
  
          $context = context_module::instance($PAGE->cm->id);
          if ($rewriteanswer) {
              $answer->answer = file_rewrite_pluginfile_urls($answer->answer, 'pluginfile.php', $context->id,
                      'mod_lesson', 'page_answers', $answer->id);
          }
          $answer->response = file_rewrite_pluginfile_urls($answer->response, 'pluginfile.php', $context->id,
                  'mod_lesson', 'page_responses', $answer->id);
  
          return $answer;
      }
code: public static function rewrite_answers_urls($answer, $rewriteanswer = true) {
          global $PAGE;
  
          $context = context_module::instance($PAGE->cm->id);
          if ($rewriteanswer) {
              $answer->answer = file_rewrite_pluginfile_urls($answer->answer, 'pluginfile.php', $context->id,
                      'mod_lesson', 'page_answers', $answer->id);
          }
          $answer->response = file_rewrite_pluginfile_urls($answer->response, 'pluginfile.php', $context->id,
                  'mod_lesson', 'page_responses', $answer->id);
  
          return $answer;
      }
code_tokens: public static function rewrite_answers_urls ( $ answer , $ rewriteanswer = true ) { global $ PAGE ; $ context = context_module :: instance ( $ PAGE -> cm -> id ) ; if ( $ rewriteanswer ) { $ answer -> answer = file_rewrite_pluginfile_urls ( $ answer -> answer , 'pluginfile.php' , $ context -> id , 'mod_lesson' , 'page_answers' , $ answer -> id ) ; } $ answer -> response = file_rewrite_pluginfile_urls ( $ answer -> response , 'pluginfile.php' , $ context -> id , 'mod_lesson' , 'page_responses' , $ answer -> id ) ; return $ answer ; }
docstring: Rewrite urls in response and optionality answer of a question answer
  
  @param object $answer
  @param bool $rewriteanswer must rewrite answer
  @return object answer with rewritten urls
docstring_tokens: Rewrite urls in response and optionality answer of a question answer