當前位置: 首頁>>代碼示例>>PHP>>正文


PHP question_type::delete_question方法代碼示例

本文整理匯總了PHP中question_type::delete_question方法的典型用法代碼示例。如果您正苦於以下問題:PHP question_type::delete_question方法的具體用法?PHP question_type::delete_question怎麽用?PHP question_type::delete_question使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在question_type的用法示例。


在下文中一共展示了question_type::delete_question方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     $DB->delete_records('question_multianswer', array('question' => $questionid));
     parent::delete_question($questionid, $contextid);
 }
開發者ID:hatone,項目名稱:moodle,代碼行數:6,代碼來源:questiontype.php

示例2: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     $DB->delete_records('question_calculated', array('question' => $questionid));
     $DB->delete_records('question_calculated_options', array('question' => $questionid));
     $DB->delete_records('question_numerical_units', array('question' => $questionid));
     if ($datasets = $DB->get_records('question_datasets', array('question' => $questionid))) {
         foreach ($datasets as $dataset) {
             if (!$DB->get_records_select('question_datasets', "question != ? AND datasetdefinition = ? ", array($questionid, $dataset->datasetdefinition))) {
                 $DB->delete_records('question_dataset_definitions', array('id' => $dataset->datasetdefinition));
                 $DB->delete_records('question_dataset_items', array('definition' => $dataset->datasetdefinition));
             }
         }
     }
     $DB->delete_records('question_datasets', array('question' => $questionid));
     parent::delete_question($questionid, $contextid);
 }
開發者ID:EmmanuelYupit,項目名稱:educursos,代碼行數:17,代碼來源:questiontype.php

示例3:

 /**
  * Deletes question from the question-type specific tables
  *
  * @param integer $questionid The question being deleted
  * @return boolean to indicate success of failure.
  */
 function delete_question($questionid, $contextid = null)
 {
     if (empty($questionid)) {
         return false;
     }
     global $DB;
     $transaction = $DB->start_delegated_transaction();
     $this->delete_question_options($questionid);
     parent::delete_question($questionid, $contextid);
     $transaction->allow_commit();
     return true;
 }
開發者ID:sunilwebaccess,項目名稱:moodle-question-matrix,代碼行數:18,代碼來源:questiontype.php

示例4: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     $DB->delete_records('qtype_multichoiceset_options', array('questionid' => $questionid));
     return parent::delete_question($questionid, $contextid);
 }
開發者ID:parksandwildlife,項目名稱:learning,代碼行數:6,代碼來源:questiontype.php

示例5: delete_question

    public function delete_question($questionid, $contextid) {
        global $DB;
        $DB->delete_records('question_match', array('question' => $questionid));
        $DB->delete_records('question_match_sub', array('question' => $questionid));

        parent::delete_question($questionid, $contextid);
    }
開發者ID:nigeldaley,項目名稱:moodle,代碼行數:7,代碼來源:questiontype.php

示例6: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     $DB->delete_records('qtype_' . $this->name(), array('questionid' => $questionid));
     $DB->delete_records('qtype_' . $this->name() . '_drags', array('questionid' => $questionid));
     $DB->delete_records('qtype_' . $this->name() . '_drops', array('questionid' => $questionid));
     return parent::delete_question($questionid, $contextid);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:8,代碼來源:questiontypebase.php

示例7: delete_question

    public function delete_question($questionid, $contextid) {
        global $DB;
        $DB->delete_records('question_numerical', array('question' => $questionid));
        $DB->delete_records('question_numerical_options', array('question' => $questionid));
        $DB->delete_records('question_numerical_units', array('question' => $questionid));

        parent::delete_question($questionid, $contextid);
    }
開發者ID:JP-Git,項目名稱:moodle,代碼行數:8,代碼來源:questiontype.php

示例8: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     $this->delete_question_tests($questionid);
     $DB->delete_records('qtype_stack_deployed_seeds', array('questionid' => $questionid));
     $DB->delete_records('qtype_stack_prt_nodes', array('questionid' => $questionid));
     $DB->delete_records('qtype_stack_prts', array('questionid' => $questionid));
     $DB->delete_records('qtype_stack_inputs', array('questionid' => $questionid));
     $DB->delete_records('qtype_stack_options', array('questionid' => $questionid));
     parent::delete_question($questionid, $contextid);
 }
開發者ID:profcab,項目名稱:moodle-qtype_stack,代碼行數:11,代碼來源:questiontype.php

示例9: delete_question

 public function delete_question($questionid, $contextid)
 {
     parent::delete_question($questionid, $contextid);
 }
開發者ID:jacac,項目名稱:qtype_order,代碼行數:4,代碼來源:questiontype.php

示例10: delete_question

 public function delete_question($questionid, $contextid)
 {
     global $DB;
     // TODO: find a solution to the problem of deleting in-use
     // prototypes. The code below isn't isn't correct (it doesn't
     // check the context of the question) so the entire block has
     // been commented out. Currently it's over to
     // to user to make sure they don't delete in-use prototypes.
     /*$question = $DB->get_record(
                     'question_coderunner_options',
                     array('questionid' => $questionid));
     
     
             if ($question->prototypetype != 0) {
                 $typeName = $question->coderunnertype;
                 $nUses = $DB->count_records('question_coderunner_options',
                         array('prototypetype' => 0,
                               'coderunnertype' => $typeName));
                 if ($nUses != 0) {
                     // TODO: see if a better solution to this problem can be found.
                     // Throwing an exception is very heavy-handed but the return
                     // value from this function is ignored by the question bank,
                     // and other deletion (e.g. of the question itself) proceeds
                     // regardless, leaving things in an even worse state than if
                     // I didn't even check for an in-use prototype!
                     throw new moodle_exception('Attempting to delete in-use prototype');
                 }
             }
     
             */
     $success = $DB->delete_records("question_coderunner_tests", array('questionid' => $questionid));
     return $success && parent::delete_question($questionid, $contextid);
 }
開發者ID:pac,項目名稱:CodeRunner,代碼行數:33,代碼來源:questiontype.php


注:本文中的question_type::delete_question方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。