当前位置: 首页>>代码示例>>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;未经允许,请勿转载。