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


PHP default_questiontype::find_file_links方法代码示例

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


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

示例1: array

 function find_file_links($question, $courseid)
 {
     // find links in the question_match_sub table.
     $urls = array();
     if (isset($question->options->subquestions)) {
         foreach ($question->options->subquestions as $subquestion) {
             $urls += question_find_file_links_from_html($subquestion->questiontext, $courseid);
         }
         //set all the values of the array to the question object
         if ($urls) {
             $urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id)));
         }
     }
     $urls = array_merge_recursive($urls, parent::find_file_links($question, $courseid));
     return $urls;
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:16,代码来源:questiontype.php

示例2: array

 function find_file_links($question, $courseid)
 {
     $urls = array();
     // find links in the answers table.
     $urls += question_find_file_links_from_html($question->options->correctfeedback, $courseid);
     $urls += question_find_file_links_from_html($question->options->partiallycorrectfeedback, $courseid);
     $urls += question_find_file_links_from_html($question->options->incorrectfeedback, $courseid);
     foreach ($question->options->answers as $answer) {
         $urls += question_find_file_links_from_html($answer->answer, $courseid);
     }
     //set all the values of the array to the question id
     if ($urls) {
         $urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id)));
     }
     $urls = array_merge_recursive($urls, parent::find_file_links($question, $courseid));
     return $urls;
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:17,代码来源:questiontype.php

示例3: array

 function find_file_links($question, $courseid)
 {
     $urls = array();
     if ($question->options->backgroundmedia->media != '') {
         if (substr(strtolower($question->options->backgroundmedia->media), 0, 7) == 'http://') {
             $matches = array();
             //support for older questions where we have a complete url in image field
             if (preg_match('!^' . question_file_links_base_url($courseid) . '(.*)!i', $question->options->backgroundmedia->media, $matches)) {
                 if ($cleanedurl = question_url_check($urls[$matches[2]])) {
                     $urls[$cleanedurl] = null;
                 }
             }
         } else {
             if ($question->options->backgroundmedia->media != '') {
                 if ($cleanedurl = question_url_check($question->options->backgroundmedia->media)) {
                     $urls[$cleanedurl] = null;
                     //will be set later
                 }
             }
         }
     }
     foreach ($question->options->media as $media) {
         if ($media->media != '') {
             if (substr(strtolower($media->media), 0, 7) == 'http://') {
                 $matches = array();
                 if (preg_match('!^' . question_file_links_base_url($courseid) . '(.*)!i', $media->media, $matches)) {
                     if ($cleanedurl = question_url_check($urls[$matches[2]])) {
                         $urls[$cleanedurl] = null;
                     }
                 }
             } else {
                 if ($media->media != '') {
                     if ($cleanedurl = question_url_check($media->media)) {
                         $urls[$cleanedurl] = null;
                         //will be set later
                     }
                 }
             }
         }
         $urls += question_find_file_links_from_html($media->questiontext, $courseid);
     }
     $urls += question_find_file_links_from_html($question->options->feedbackok, $courseid);
     $urls += question_find_file_links_from_html($question->options->feedbackmissed, $courseid);
     //set all the values of the array to the question object
     if ($urls) {
         $urls = array_combine(array_keys($urls), array_fill(0, count($urls), array($question->id)));
     }
     $urls = array_merge_recursive($urls, parent::find_file_links($question, $courseid));
     return $urls;
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:50,代码来源:questiontype.php


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