Add category elements auto weight see BT#9427

1.10.x
Julio Montoya 10 years ago
parent 27c7989031
commit 93d2bd5f6c
  1. 240
      main/gradebook/gradebook_edit_all.php
  2. 75
      main/gradebook/lib/GradebookUtils.php
  3. 22
      main/gradebook/lib/be/abstractlink.class.php
  4. 10
      main/gradebook/lib/be/evaluation.class.php
  5. 2
      main/gradebook/lib/be/surveylink.class.php

@ -8,13 +8,12 @@
*/
$language_file= 'gradebook';
$cidReset= true;
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GRADEBOOK;
$current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script();
api_block_anonymous_users();
if (!api_is_allowed_to_edit()) {
@ -28,28 +27,13 @@ if (empty($my_selectcat)) {
api_not_allowed();
}
// DISPLAY HEADERS AND MESSAGES
if (!isset($_GET['exportpdf']) and !isset($_GET['export_certificate'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $my_selectcat,'name' => get_lang('Gradebook'));
Display :: display_header(get_lang('FlatView'));
} elseif (isset ($_GET['search'])) {
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $my_selectcat,'name' => get_lang('Gradebook'));
Display :: display_header(get_lang('SearchResults'));
} else {
$interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=1', 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array ('url' => '#','name' => get_lang('EditAllWeights'));
Display :: display_header('');
}
}
$course_id = GradebookUtils::get_course_id_by_link_id($my_selectcat);
$course_id = GradebookUtils::get_course_id_by_link_id($my_selectcat);
$table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
$tbl_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
$tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE);
$table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);
$tbl_work = Database:: get_course_table(TABLE_STUDENT_PUBLICATION);
$tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
$table_evaluated[LINK_EXERCISE] = array(TABLE_QUIZ_TEST, 'title', 'id', get_lang('Exercise'));
$table_evaluated[LINK_DROPBOX] = array(TABLE_DROPBOX_FILE, 'name','id', get_lang('Dropbox'));
@ -59,7 +43,7 @@ $table_evaluated[LINK_FORUM_THREAD] = array(TABLE_FORUM_THREAD, 'thread_ti
$table_evaluated[LINK_ATTENDANCE] = array(TABLE_ATTENDANCE, 'attendance_title_qualify', 'id', get_lang('Attendance'));
$table_evaluated[LINK_SURVEY] = array(TABLE_SURVEY, 'code', 'survey_id', get_lang('Survey'));
$submitted = isset($_POST['submitted'])?$_POST['submitted']:'';
$submitted = isset($_POST['submitted']) ? $_POST['submitted'] : '';
if ($submitted==1) {
Display :: display_confirmation_message(get_lang('GradebookWeightUpdated')) . '<br /><br />';
if (isset($_POST['evaluation'])) {
@ -76,48 +60,23 @@ $parent_cat = Category::load($parent_id);
$my_category = array();
$cat = new Category();
$my_category = $cat->shows_all_information_an_category($my_selectcat);
$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');
while ($row = Database ::fetch_array($result)) {
foreach ($links as &$row) {
$item_weight = $row['weight'];
//$item_weight = $masked_total*$item_weight/$original_total;
//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']]);
AbstractLink::add_link_log($row['id']);
Database::query('UPDATE '.$table_link.' SET weight = '."'".Database::escape_string($new_weight)."'".' WHERE id = '.$row['id']);
$item_weight = trim($_POST['link'][$row['id']]);
//Update weight for attendance
$sql = 'SELECT ref_id FROM '.$table_link.' WHERE id = '.intval($row['id']).' AND type='.LINK_ATTENDANCE;
$rs_attendance = Database::query($sql);
if (Database::num_rows($rs_attendance) > 0) {
$row_attendance = Database::fetch_array($rs_attendance);
$upd_attendance = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.floatval($_POST['link'][$row['id']]).'
WHERE c_id = '.$course_id.' AND id = '.intval($row_attendance['ref_id']);
Database::query($upd_attendance);
}
//Update weight into forum thread
$sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.floatval($_POST['link'][$row['id']]).'
WHERE c_id = '.$course_id.' AND thread_id = (SELECT ref_id FROM '.$table_link.' WHERE id='.intval($row['id']).' AND type='.LINK_FORUM_THREAD.' ) ';
Database::query($sql_t);
//Update weight into student publication(work)
$sql_t='UPDATE '.$tbl_work.' SET weight='.floatval($_POST['link'][$row['id']]).'
WHERE c_id = '.$course_id.' AND id = (SELECT ref_id FROM '.$table_link.' WHERE id='.intval($row['id']).' AND type = '.LINK_STUDENTPUBLICATION.' ) ';
Database::query($sql_t);
}
$tempsql = Database::query('SELECT * FROM '.GradebookUtils::get_table_type_course($row['type']).' WHERE c_id = '.$course_id.' AND '.$table_evaluated[$row['type']][2].' = '.$row['ref_id']);
$resource_name = Database ::fetch_array($tempsql);
//
$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[2];
@ -125,33 +84,122 @@ while ($row = Database ::fetch_array($result)) {
$resource_name = $resource_name[1];
}
$output.= '<tr><td>'.GradebookUtils::build_type_icon_tag($row['type']).'</td><td> '.$resource_name.' '.Display::label($table_evaluated[$row['type']][3],'info').' </td>';
$output.= '<td><input type="hidden" name="link_'.$row['id'].'" value="'.$resource_name.'" /><input size="10" type="text" name="link['.$row['id'].']" value="'.$item_weight.'"/></td></tr>';
$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;
}
$output.= '<tr><td>'.GradebookUtils::build_type_icon_tag($row['type']).'</td>
<td> '.$resource_name.' '.Display::label($table_evaluated[$row['type']][3],'info').' </td>';
$output.= '<td>
<input type="hidden" name="link_'.$row['id'].'" value="'.$resource_name.'" />
<input size="10" type="text" name="link['.$row['id'].']" value="'.$item_weight.'"/>
</td></tr>';
}
$sql = Database::query('SELECT * FROM '.$table_evaluation.' WHERE category_id = '.$my_selectcat);
while ($row = Database ::fetch_array($sql)) {
$item_weight = $row['weight'];
$sql = 'SELECT * FROM '.$table_evaluation.' WHERE category_id = '.$my_selectcat;
$result = Database::query($sql);
$evaluations = Database::store_result($result);
foreach ($evaluations as $evaluationRow) {
$item_weight = $evaluationRow['weight'];
//$item_weight = $masked_total*$item_weight/$original_total;
//update only if value changed
if (isset($_POST['evaluation'][$row['id']])) {
Evaluation::add_evaluation_log($row['id']);
//$new_weight = trim($_POST['evaluation'][$row['id']]*$original_total/$masked_total);
$new_weight = trim($_POST['evaluation'][$row['id']]);
$update_sql = 'UPDATE '.$table_evaluation.' SET weight = '."'".Database::escape_string($new_weight)."'".' WHERE id = '.$row['id'];
Database::query($update_sql);
$item_weight = trim($_POST['evaluation'][$row['id']]);
if (isset($_POST['evaluation'][$evaluationRow['id']])) {
//$new_weight = trim($_POST['evaluation'][$evaluationRow['id']]*$original_total/$masked_total);
$new_weight = trim($_POST['evaluation'][$evaluationRow['id']]);
GradebookUtils::updateEvaluationWeight($evaluationRow['id'], $new_weight);
$item_weight = $new_weight;
}
$type_evaluated = isset($row['type']) ? $table_evaluated[$type_evaluated][3] : null;
$output.= '<tr><td>'.GradebookUtils::build_type_icon_tag('evalnotempty').'</td><td>'.$row['name'].' '.Display::label(get_lang('Evaluation').$type_evaluated).'</td>';
$output.= '<td><input type="hidden" name="eval_'.$row['id'].'" value="'.$row['name'].'" /><input type="text" size="10" name="evaluation['.$row['id'].']" value="'.$item_weight.'"/></td></tr>';
$output.= '<tr>
<td>'.GradebookUtils::build_type_icon_tag('evalnotempty').'</td>
<td>'.$evaluationRow['name'].' '.Display::label(get_lang('Evaluation')).'</td>';
$output.= '<td>
<input type="hidden" name="eval_'.$evaluationRow['id'].'" value="'.$evaluationRow['name'].'" />
<input type="text" size="10" name="evaluation['.$evaluationRow['id'].']" value="'.$item_weight.'"/>
</td></tr>';
}
//by iflorespaz
$my_api_cidreq = api_get_cidreq();
if ($my_api_cidreq=='') {
$my_api_cidreq='cidReq='.$my_category['course_code'];
}
$currentUrl = api_get_self().'?'.api_get_cidreq().'&selectcat='.$my_selectcat;
$form = new FormValidator('auto_weight', 'post', $currentUrl);
$form->addHeader(get_lang('AutoWeight'));
$form->addLabel(null, get_lang('AutoWeightExplanation'));
$form->addButtonUpdate(get_lang('AutoWeight'));
if ($form->validate()) {
$itemCount = count($links) + count($evaluations);
$weight = round($original_total / $itemCount, 2);
$total = $weight * $itemCount;
$diff = null;
if ($original_total !== $total) {
if ($total > $original_total) {
$diff = $total - $original_total;
}
}
$total = 0;
$diffApplied = false;
foreach ($links as $link) {
$weightToApply = $weight;
if ($diffApplied == false) {
if (!empty($diff)) {
$weightToApply = $weight - $diff;
$diffApplied = true;
}
}
GradebookUtils::updateLinkWeight(
$link['id'],
$link['resource_name'],
$weightToApply
);
}
foreach ($evaluations as $evaluation) {
$weightToApply = $weight;
if ($diffApplied == false) {
if (!empty($diff)) {
$weightToApply = $weight - $diff;
$diffApplied = true;
}
}
GradebookUtils::updateEvaluationWeight($evaluation['id'], $weightToApply);
}
header('Location:'.$currentUrl);
exit;
}
// DISPLAY HEADERS AND MESSAGES
if (!isset($_GET['exportpdf']) and !isset($_GET['export_certificate'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $my_selectcat,'name' => get_lang('Gradebook'));
Display :: display_header(get_lang('FlatView'));
} elseif (isset ($_GET['search'])) {
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $my_selectcat,'name' => get_lang('Gradebook'));
Display :: display_header(get_lang('SearchResults'));
} else {
$interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=1', 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array ('url' => '#','name' => get_lang('EditAllWeights'));
Display :: display_header('');
}
}
?>
<div class="actions">
<a href="<?php echo Security::remove_XSS($_SESSION['gradebook_dest']).'?'.$my_api_cidreq ?>&selectcat=<?php echo $my_selectcat ?>">
@ -159,23 +207,33 @@ if ($my_api_cidreq=='') {
</a>
</div>
<?php
$warning_message = sprintf(get_lang('TotalWeightMustBeX'), $masked_total);
Display::display_normal_message($warning_message, false);
$form->display();
$formNormal = new FormValidator('normal_weight', 'post', $currentUrl);
$formNormal->addHeader(get_lang('EditWeight'));
$formNormal->display();
//$warning_message = sprintf(get_lang('TotalWeightMustBeX'), $masked_total);
$warning_message = sprintf(get_lang('TotalWeightMustBeX'), $original_total);
Display::display_warning_message($warning_message, false);
?>
<form method="post" action="gradebook_edit_all.php?<?php echo $my_api_cidreq ?>&selectcat=<?php echo $my_selectcat?>">
<table class="data_table">
<tr class="row_odd">
<th style="width: 35px;"><?php echo get_lang('Type'); ?></th>
<th><?php echo get_lang('Resource'); ?></th>
<th><?php echo get_lang('Weight'); ?></th>
</tr>
<?php echo $output; ?>
</table>
<input type="hidden" name="submitted" value="1" />
<br />
<button class="save" type="submit" name="name" value="<?php echo get_lang('Save') ?>">
<?php echo get_lang('SaveScoringRules') ?>
</button>
</form>
<form method="post" action="gradebook_edit_all.php?<?php echo $my_api_cidreq ?>&selectcat=<?php echo $my_selectcat?>">
<table class="data_table">
<tr class="row_odd">
<th style="width: 35px;"><?php echo get_lang('Type'); ?></th>
<th><?php echo get_lang('Resource'); ?></th>
<th><?php echo get_lang('Weight'); ?></th>
</tr>
<?php echo $output; ?>
</table>
<input type="hidden" name="submitted" value="1" />
<br />
<button class="btn btn-primary" type="submit" name="name" value="<?php echo get_lang('Save') ?>">
<?php echo get_lang('SaveScoringRules') ?>
</button>
</form>
<?php
Display :: display_footer();

@ -202,7 +202,6 @@ class GradebookUtils
// Locking button
if (api_get_setting('gradebook_locking_enabled') == 'true') {
if ($cat->is_locked()) {
if (api_is_platform_admin()) {
$modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToUnlockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=unlock">' .
@ -215,7 +214,6 @@ class GradebookUtils
$modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToLockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=lock">' .
Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL) . '</a>';
$modify_icons .= '&nbsp;<a href="#" >' . Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>';
//$modify_icons .= '&nbsp;<a href="gradebook_flatview.php?export_pdf=category&selectcat=' . $cat->get_id() . '" >'.Display::return_icon('pdf.png', get_lang('ExportToPDF'),'',ICON_SIZE_SMALL).'</a>';
}
}
@ -233,13 +231,14 @@ class GradebookUtils
}
}
$modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&cidReq=' . $cat->get_course_code() . '&id_session='.$cat->get_session_id().'">' .
$modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&cidReq=' . $cat->get_course_code() . '&id_session='.$cat->get_session_id().'">' .
Display::return_icon(
'percentage.png',
get_lang('EditAllWeights'),
'',
ICON_SIZE_SMALL
) . '</a>';
$modify_icons .= '<a href="gradebook_flatview.php?selectcat=' .$cat->get_id() . '&cidReq=' . $cat->get_course_code() . '&id_session='.$cat->get_session_id(). '">' .
Display::return_icon(
'stats.png',
@ -1098,4 +1097,74 @@ class GradebookUtils
return $users;
}
/**
* @param int $linkId
* @param float $weight
*/
public static function updateLinkWeight($linkId, $name, $weight)
{
$linkId = intval($linkId);
$weight = floatval($weight);
$course_id = api_get_course_int_id();
AbstractLink::add_link_log($linkId, $name);
$table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_forum_thread = Database:: get_course_table(TABLE_FORUM_THREAD);
$tbl_work = Database:: get_course_table(TABLE_STUDENT_PUBLICATION);
$tbl_attendance = Database:: get_course_table(TABLE_ATTENDANCE);
$sql = 'UPDATE '.$table_link.' SET weight = '."'".Database::escape_string($weight)."'".'
WHERE id = '.$linkId;
Database::query($sql);
// Update weight for attendance
$sql = 'SELECT ref_id FROM '.$table_link.'
WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE;
$rs_attendance = Database::query($sql);
if (Database::num_rows($rs_attendance) > 0) {
$row_attendance = Database::fetch_array($rs_attendance);
$sql = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.$weight.'
WHERE c_id = '.$course_id.' AND id = '.intval($row_attendance['ref_id']);
Database::query($sql);
}
// Update weight into forum thread
$sql = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$weight.'
WHERE
c_id = '.$course_id.' AND
thread_id = (
SELECT ref_id FROM '.$table_link.'
WHERE id='.$linkId.' AND type='.LINK_FORUM_THREAD.'
)
';
Database::query($sql);
//Update weight into student publication(work)
$sql = 'UPDATE '.$tbl_work.' SET weight='.$weight.'
WHERE
c_id = '.$course_id.' AND id = (
SELECT ref_id FROM '.$table_link.'
WHERE id='.$linkId.' AND type = '.LINK_STUDENTPUBLICATION.'
) ';
Database::query($sql);
}
/**
* @param int $id
* @param float $weight
*/
public static function updateEvaluationWeight($id, $weight)
{
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$id = intval($id);
$evaluation = new Evaluation();
$evaluation->add_evaluation_log($id);
$sql = 'UPDATE '.$table_evaluation.'
SET weight = '."'".Database::escape_string($weight)."'".'
WHERE id = '.$id;
Database::query($sql);
}
}

@ -333,21 +333,25 @@ abstract class AbstractLink implements GradebookItem
/**
* @param int $idevaluation
*/
public static function add_link_log($idevaluation)
public static function add_link_log($idevaluation, $nameLog = null)
{
$tbl_grade_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
$dateobject=AbstractLink::load ($idevaluation,null,null,null,null);
$current_date_server=api_get_utc_datetime();
$arreval=get_object_vars($dateobject[0]);
$description_log=isset($arreval['description'])?$arreval['description']:'';
if (isset($_POST['name_link'])) {
$name_log=isset($_POST['name_link'])?Security::remove_XSS($_POST['name_link']):$arreval['course_code'];
} elseif ($_POST['link_'.$idevaluation]) {
$name_log=$_POST['link_'.$idevaluation];
$arreval = get_object_vars($dateobject[0]);
$description_log = isset($arreval['description']) ? $arreval['description']:'';
if (empty($nameLog)) {
if (isset($_POST['name_link'])) {
$name_log = isset($_POST['name_link']) ? Security::remove_XSS($_POST['name_link']) : $arreval['course_code'];
} elseif (isset($_POST['link_' . $idevaluation]) && $_POST['link_' . $idevaluation]) {
$name_log = $_POST['link_' . $idevaluation];
} else {
$name_log = $arreval['course_code'];
}
} else {
$name_log=$arreval['course_code'];
$name_log = $nameLog;
}
$sql="INSERT INTO ".$tbl_grade_linkeval_log."(id_linkeval_log,name,description,created_at,weight,visible,type,user_id_log)
$sql="INSERT INTO ".$tbl_grade_linkeval_log."(id_linkeval_log, name,description,created_at,weight,visible,type,user_id_log)
VALUES('".Database::escape_string($arreval['id'])."','".Database::escape_string($name_log)."','".Database::escape_string($description_log)."','".Database::escape_string($current_date_server)."','".Database::escape_string($arreval['weight'])."','".Database::escape_string($arreval['visible'])."','Link',".api_get_user_id().")";
Database::query($sql);

@ -325,15 +325,15 @@ class Evaluation implements GradebookItem
if (!empty($idevaluation)) {
$tbl_grade_evaluations = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_grade_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
$eval=new Evaluation();
$dateobject=$eval->load ($idevaluation,null,null,null,null);
$arreval=get_object_vars($dateobject[0]);
$eval = new Evaluation();
$dateobject = $eval->load($idevaluation,null,null,null,null);
$arreval = get_object_vars($dateobject[0]);
if (!empty($arreval['id'])) {
$sql_eval='SELECT weight from '.$tbl_grade_evaluations.' WHERE id='.$arreval['id'];
$rs=Database::query($sql_eval);
$row_old_weight=Database::fetch_array($rs,'ASSOC');
$current_date=api_get_utc_datetime();
$sql="INSERT INTO ".$tbl_grade_linkeval_log."(id_linkeval_log,name,description,created_at,weight,visible,type,user_id_log)
$sql = "INSERT INTO ".$tbl_grade_linkeval_log."(id_linkeval_log,name,description,created_at,weight,visible,type,user_id_log)
VALUES('".Database::escape_string($arreval['id'])."','".Database::escape_string($arreval['name'])."','".Database::escape_string($arreval['description'])."','".$current_date."','".Database::escape_string($row_old_weight['weight'])."','".Database::escape_string($arreval['visible'])."','evaluation',".api_get_user_id().")";
Database::query($sql);
}
@ -373,7 +373,7 @@ class Evaluation implements GradebookItem
.' WHERE id = '.intval($this->id);
//recorded history
$eval_log=new Evaluation();
$eval_log = new Evaluation();
$eval_log->add_evaluation_log($this->id);
Database::query($sql);
}

@ -102,7 +102,7 @@ class SurveyLink extends AbstractLink
SELECT ref_id FROM '.$tbl_grade_links.'
WHERE
type = '.LINK_SURVEY.' AND
course_code = '".$this->get_course_code()."'
course_code = "'.$this->get_course_code().'"
)
AND srv.session_id = '.api_get_session_id();

Loading…
Cancel
Save