original_string: public function delete_previews($questionid) {
          $previews = $this->db->get_records_sql_menu("
                  SELECT DISTINCT quba.id, 1
                  FROM {question_usages} quba
                  JOIN {question_attempts} qa ON qa.questionusageid = quba.id
                  WHERE quba.component = 'core_question_preview' AND
                      qa.questionid = ?", array($questionid));
          if (empty($previews)) {
              return;
          }
          $this->delete_questions_usage_by_activities(new qubaid_list($previews));
      }
code: public function delete_previews($questionid) {
          $previews = $this->db->get_records_sql_menu("
                  SELECT DISTINCT quba.id, 1
                  FROM {question_usages} quba
                  JOIN {question_attempts} qa ON qa.questionusageid = quba.id
                  WHERE quba.component = 'core_question_preview' AND
                      qa.questionid = ?", array($questionid));
          if (empty($previews)) {
              return;
          }
          $this->delete_questions_usage_by_activities(new qubaid_list($previews));
      }
code_tokens: public function delete_previews ( $ questionid ) { $ previews = $ this -> db -> get_records_sql_menu ( "
                  SELECT DISTINCT quba.id, 1
                  FROM {question_usages} quba
                  JOIN {question_attempts} qa ON qa.questionusageid = quba.id
                  WHERE quba.component = 'core_question_preview' AND
                      qa.questionid = ?" , array ( $ questionid ) ) ; if ( empty ( $ previews ) ) { return ; } $ this -> delete_questions_usage_by_activities ( new qubaid_list ( $ previews ) ) ; }
docstring: Delete all the previews for a given question.
  
  Private method, only for use by other parts of the question engine.
  
  @param int $questionid question id.
docstring_tokens: Delete all the previews for a given question .