当前位置: 首页>>代码示例>>PHP>>正文


PHP question_engine::get_all_response_file_areas方法代码示例

本文整理汇总了PHP中question_engine::get_all_response_file_areas方法的典型用法代码示例。如果您正苦于以下问题:PHP question_engine::get_all_response_file_areas方法的具体用法?PHP question_engine::get_all_response_file_areas怎么用?PHP question_engine::get_all_response_file_areas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在question_engine的用法示例。


在下文中一共展示了question_engine::get_all_response_file_areas方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add_question_usages

 /**
  * Attach to $element (usually attempts) the needed backup structures
  * for question_usages and all the associated data.
  */
 protected function add_question_usages($element, $usageidname)
 {
     global $CFG;
     require_once $CFG->dirroot . '/question/engine/lib.php';
     // Check $element is one nested_backup_element
     if (!$element instanceof backup_nested_element) {
         throw new backup_step_exception('question_states_bad_parent_element', $element);
     }
     if (!$element->get_final_element($usageidname)) {
         throw new backup_step_exception('question_states_bad_question_attempt_element', $usageidname);
     }
     $quba = new backup_nested_element('question_usage', array('id'), array('component', 'preferredbehaviour'));
     $qas = new backup_nested_element('question_attempts');
     $qa = new backup_nested_element('question_attempt', array('id'), array('slot', 'behaviour', 'questionid', 'maxmark', 'minfraction', 'flagged', 'questionsummary', 'rightanswer', 'responsesummary', 'timemodified'));
     $steps = new backup_nested_element('steps');
     $step = new backup_nested_element('step', array('id'), array('sequencenumber', 'state', 'fraction', 'timecreated', 'userid'));
     $response = new backup_nested_element('response');
     $variable = new backup_nested_element('variable', null, array('name', 'value'));
     // Build the tree
     $element->add_child($quba);
     $quba->add_child($qas);
     $qas->add_child($qa);
     $qa->add_child($steps);
     $steps->add_child($step);
     $step->add_child($response);
     $response->add_child($variable);
     // Set the sources
     $quba->set_source_table('question_usages', array('id' => '../' . $usageidname));
     $qa->set_source_sql('
             SELECT *
             FROM {question_attempts}
             WHERE questionusageid = :questionusageid
             ORDER BY slot', array('questionusageid' => backup::VAR_PARENTID));
     $step->set_source_sql('
             SELECT *
             FROM {question_attempt_steps}
             WHERE questionattemptid = :questionattemptid
             ORDER BY sequencenumber', array('questionattemptid' => backup::VAR_PARENTID));
     $variable->set_source_table('question_attempt_step_data', array('attemptstepid' => backup::VAR_PARENTID));
     // Annotate ids
     $qa->annotate_ids('question', 'questionid');
     $step->annotate_ids('user', 'userid');
     // Annotate files
     $fileareas = question_engine::get_all_response_file_areas();
     foreach ($fileareas as $filearea) {
         $step->annotate_files('question', $filearea, 'id');
     }
 }
开发者ID:nutanrajmalanai,项目名称:moodle,代码行数:52,代码来源:backup_stepslib.php

示例2: after_execute

 protected function after_execute()
 {
     parent::after_execute();
     // Restore any files belonging to responses.
     foreach (question_engine::get_all_response_file_areas() as $filearea) {
         $this->add_related_files('question', $filearea, 'question_attempt_step');
     }
 }
开发者ID:Jinelle,项目名称:moodle,代码行数:8,代码来源:restore_stepslib.php

示例3: delete_response_files

 /**
  * Delete all the files belonging to the response variables in the gives
  * question attempt steps.
  * @param int $contextid the context these attempts belong to.
  * @param string $itemidstest a bit of SQL that can be used in a
  *      WHERE itemid $itemidstest clause. Must use named params.
  * @param array $params any query parameters used in $itemidstest.
  */
 protected function delete_response_files($contextid, $itemidstest, $params)
 {
     $fs = get_file_storage();
     foreach (question_engine::get_all_response_file_areas() as $filearea) {
         $fs->delete_area_files_select($contextid, 'question', $filearea, $itemidstest, $params);
     }
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:15,代码来源:datalib.php


注:本文中的question_engine::get_all_response_file_areas方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。