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


PHP GradebookUtils::get_table_type_course方法代码示例

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


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

示例1: array

$my_cat = $my_cat[0];
$parent_id = $my_cat->get_parent_id();
$parent_cat = Category::load($parent_id);
$my_category = array();
$cat = new Category();
$my_category = $cat->shows_all_information_an_category($my_selectcat);
$original_total = $my_category['weight'];
$masked_total = $parent_cat[0]->get_weight();
$sql = 'SELECT * FROM ' . $table_link . ' WHERE category_id = ' . $my_selectcat;
$result = Database::query($sql);
$links = Database::store_result($result, 'ASSOC');
foreach ($links as &$row) {
    $item_weight = $row['weight'];
    //$item_weight = $masked_total*$item_weight/$original_total;
    //
    $sql = 'SELECT * FROM ' . GradebookUtils::get_table_type_course($row['type']) . '
            WHERE c_id = ' . $course_id . ' AND ' . $table_evaluated[$row['type']][2] . ' = ' . $row['ref_id'];
    $result = Database::query($sql);
    $resource_name = Database::fetch_array($result);
    if (isset($resource_name['lp_type'])) {
        $resource_name = $resource_name[4];
    } else {
        $resource_name = $resource_name[3];
    }
    $row['resource_name'] = $resource_name;
    // Update only if value changed
    if (isset($_POST['link'][$row['id']])) {
        //$new_weight = trim($_POST['link'][$row['id']]*$original_total/$masked_total);
        $new_weight = trim($_POST['link'][$row['id']]);
        GradebookUtils::updateLinkWeight($row['id'], $resource_name, $new_weight);
        $item_weight = $new_weight;
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:gradebook_edit_all.php

示例2: array

}
$output = '';
$my_cat = Category::load($my_selectcat);
$my_cat = $my_cat[0];
$parent_id = $my_cat->get_parent_id();
$parent_cat = Category::load($parent_id);
$my_category = array();
$cat = new Category();
$my_category = $cat->shows_all_information_an_category($my_selectcat);
$original_total = $my_category->getWeight();
$masked_total = $parent_cat[0]->get_weight();
$links = $em->getRepository('ChamiloCoreBundle:GradebookLink')->findBy(['categoryId' => $my_selectcat]);
$linksInfo = [];
foreach ($links as $row) {
    $item_weight = $row->getWeight();
    $sql = 'SELECT * FROM ' . GradebookUtils::get_table_type_course($row->getType()) . '
            WHERE c_id = ' . $course_id . ' AND ' . $table_evaluated[$row->getType()][2] . ' = ' . $row->getRefId();
    $result = Database::query($sql);
    $resource_name = Database::fetch_array($result);
    if (isset($resource_name['lp_type'])) {
        $resource_name = $resource_name[4];
    } else {
        $resource_name = $resource_name[3];
    }
    $linksInfo[] = ['id' => $row->getId(), 'resource_name' => $resource_name];
    // Update only if value changed
    if (isset($_POST['link'][$row->getId()])) {
        $new_weight = trim($_POST['link'][$row->getId()]);
        GradebookUtils::updateLinkWeight($row->getId(), $resource_name, $new_weight);
        $item_weight = $new_weight;
    }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:gradebook_edit_all.php


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