Only course gradebook with certificate in the gradebook list in the Skill page

skala
Julio Montoya 14 years ago
parent a8822a24c3
commit 95ff3a4157
  1. 12
      main/inc/ajax/skill.ajax.php
  2. 22
      main/inc/lib/gradebook.lib.php

@ -14,7 +14,6 @@ $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : null;
$skill = new Skill();
$gradebook = new Gradebook();
$skill_gradebook = new SkillRelGradebook();
$skill_rel_skill = new SkillRelSkill();
switch ($action) {
case 'add':
@ -24,8 +23,7 @@ switch ($action) {
$skill->add($_REQUEST);
}
break;
case 'find_skills':
$tag = Database::escape_string($_REQUEST['tag']);
case 'find_skills':
$skills = $skill->find('all', array('where' => array('name LIKE %?% '=>$_REQUEST['tag'])));
$return_skills = array();
foreach($skills as $skill) {
@ -36,12 +34,12 @@ switch ($action) {
echo json_encode($return_skills);
break;
case 'get_gradebooks':
$gradebooks = $gradebook_list = $gradebook->get_all();
$gradebooks = $gradebook_list = $gradebook->get_all();
$gradebook_list = array();
//only course gradebook
//Only course gradebook with certificate
if (!empty($gradebooks)) {
foreach($gradebooks as $gradebook) {
if ($gradebook['parent_id'] == 0) {
foreach ($gradebooks as $gradebook) {
if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) {
$gradebook_list[] = $gradebook;
//$gradebook['name'] = $gradebook['name'];
//$gradebook_list[] = $gradebook;

@ -8,21 +8,16 @@
/**
* Code
*/
class Gradebook extends Model {
var $columns = array('id', 'name','description', 'course_code', 'parent_id');
public function __construct() {
$this->table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$this->table_skill = Database::get_main_table(TABLE_MAIN_SKILL);
$this->table_skill_rel_gradebook = Database::get_main_table(TABLE_MAIN_SKILL_REL_GRADEBOOK);
$this->table_skill_rel_gradebook = Database::get_main_table(TABLE_MAIN_SKILL_REL_GRADEBOOK);
}
public function get_all($options = array()) {
$gradebooks = parent::get_all($options);
foreach($gradebooks as &$gradebook) {
@ -72,8 +67,6 @@ class Gradebook extends Model {
return false;
}
/**
* Returns a Form validator Obj
* @todo the form should be auto generated
@ -91,8 +84,7 @@ class Gradebook extends Model {
$form->addElement('header', '', $header);
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
$form->addElement('hidden', 'id', $id);
//$status_list = $this->get_status_list();
$skill = new Skill();
$skills = $skill->get_all();
$clean_skill_list = array();
@ -131,14 +123,6 @@ class Gradebook extends Model {
*/
public function display() {
// action links
/*
echo '<div class="actions" style="margin-bottom:20px">';
echo '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>';
// echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('new_career.png',get_lang('Add'),'','32').'</a>';
echo '</div>';
*/
echo Display::grid_html('gradebooks');
}
}
Loading…
Cancel
Save