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


PHP LTIX::customGet方法代码示例

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


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

示例1: linkGetAll

 /**
  * Retrieve an array of all of the link level settings
  *
  * If there are no settings, return an empty array.  
  *
  * This routine also looks for legacy custom fields and treats
  * them as defaults for settings if the corresponding key is not
  * already present in settings.  This will slowly convert LTI 
  * 1.x custom parameters under the control of the LMS to LTI 2.x 
  * style settings under control of our local tools.
  */
 public static function linkGetAll()
 {
     global $CFG, $PDOX, $LINK;
     if (!isset($_SESSION['lti'])) {
         return array();
     }
     if (isset($_SESSION['lti']['link_settings_merge'])) {
         return $_SESSION['lti']['link_settings_merge'];
     }
     $legacy_fields = array('dologin', 'close', 'due', 'timezone', 'penalty_time', 'penalty_cost');
     $defaults = array();
     foreach ($legacy_fields as $k) {
         $value = LTIX::customGet($k);
         $defaults[$k] = $value;
     }
     if (isset($_SESSION['lti']['link_settings'])) {
         $json = $_SESSION['lti']['link_settings'];
         if (strlen($json) < 0) {
             return $defaults;
         }
         $retval = json_decode($json, true);
         // No objects
         $retval = array_merge($defaults, $retval);
         $_SESSION['lti']['link_settings_array'] = $retval;
         return $retval;
     }
     // Not in session - retrieve from the database
     // We cannot assume the $LINK is fully set up yet...
     if (!isset($_SESSION['lti']['link_id'])) {
         return $defaults;
     }
     $row = $PDOX->rowDie("SELECT settings FROM {$CFG->dbprefix}lti_link WHERE link_id = :LID", array(":LID" => $_SESSION['lti']['link_id']));
     if ($row === false) {
         return $defaults;
     }
     $json = $row['settings'];
     if ($json === null) {
         return $defaults;
     }
     $retval = json_decode($json, true);
     // No objects
     $retval = array_merge($defaults, $retval);
     // Store in session for later
     $_SESSION['lti']['link_settings'] = $json;
     $_SESSION['lti']['link_settings_array'] = $retval;
     return $retval;
 }
开发者ID:csev,项目名称:tsugi-php,代码行数:58,代码来源:Settings.php

示例2: isset

count = 0
for line in fh:
    print line.strip()
    count = count + 1

print count,"Lines"';
$CHECKS = false;
$EX = false;

// Check which exercise we are supposed to do - settings, then custom, then 
// GET
if ( isset($oldsettings['exercise']) && $oldsettings['exercise'] != '0' ) {
    $ex = $oldsettings['exercise'];
} else {
    $ex = LTIX::customGet('exercise');
}
if ( $ex === false && isset($_REQUEST["exercise"]) ) {
    $ex = $_REQUEST["exercise"];
}
if ( $ex !== false && $ex != "code" ) {
    if ( isset($EXERCISES[$ex]) ) $EX = $EXERCISES[$ex];
    if ( $EX !== false ) {
        $CODE = '';
        $QTEXT = $EX["qtext"];
        $DESIRED = $EX["desired"];
        $DESIRED2 = isset($EX["desired2"]) ? $EX["desired2"] : '';
        $DESIRED = rtrim($DESIRED);
        $DESIRED2 = rtrim($DESIRED2);
        if ( isset($EX["code"]) ) $CODE = $EX["code"];
        if ( isset($EX["checks"]) ) $CHECKS = json_encode($EX["checks"]);
开发者ID:JANQLIANGTSAI,项目名称:tsugi,代码行数:30,代码来源:index.php


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