本文整理汇总了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;
示例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;
}