當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。