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


PHP assQuestion::_resolveInternalLink方法代碼示例

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


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

示例1: _resolveIntLinks

 function _resolveIntLinks($question_id)
 {
     global $ilDB;
     $resolvedlinks = 0;
     $result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s", array('integer'), array($question_id));
     if ($result->numRows()) {
         while ($row = $ilDB->fetchAssoc($result)) {
             $internal_link = $row["internal_link"];
             include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
             $resolved_link = assQuestion::_resolveInternalLink($internal_link);
             if (strcmp($internal_link, $resolved_link) != 0) {
                 // internal link was resolved successfully
                 $affectedRows = $ilDB->manipulateF("UPDATE qpl_sol_sug SET internal_link = %s WHERE suggested_solution_id = %s", array('text', 'integer'), array($resolved_link, $row["suggested_solution_id"]));
                 $resolvedlinks++;
             }
         }
     }
     if ($resolvedlinks) {
         // there are resolved links -> reenter theses links to the database
         // delete all internal links from the database
         include_once "./Services/Link/classes/class.ilInternalLink.php";
         ilInternalLink::_deleteAllLinksOfSource("qst", $question_id);
         $result = $ilDB->queryF("SELECT * FROM qpl_sol_sug WHERE question_fi = %s", array('integer'), array($question_id));
         if ($result->numRows()) {
             while ($row = $ilDB->fetchAssoc($result)) {
                 if (preg_match("/il_(\\d*?)_(\\w+)_(\\d+)/", $row["internal_link"], $matches)) {
                     ilInternalLink::_saveLink("qst", $question_id, $matches[2], $matches[3], $matches[1]);
                 }
             }
         }
     }
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:32,代碼來源:class.assQuestion.php


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