From 17a61a164842be83a233a0c758b406f88d3200b8 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Fri, 2 Jan 2009 23:46:25 +0100 Subject: [PATCH] [svn r17516] logic changes - allows remove links of the gradebook tool - (partial de FS#3415) --- main/exercice/exercice.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index e63dc5fe37..11d4325af8 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1,4 +1,4 @@ -delete(); + + //delete link of exercise of gradebook tool + $sql='SELECT gl.id FROM '.$tbl_grade_link.' gl WHERE gl.type="1" AND gl.ref_id="'.$exerciseId.'";'; + $result=api_sql_query($sql,__FILE__,__LINE__); + $row=Database::fetch_array($result,'ASSOC'); + + $link= LinkFactory :: load($row['id']); + if ($link[0] != null) { + $link[0]->delete(); + } Display::display_confirmation_message(get_lang('ExerciseDeleted')); break; case 'enable': // enables an exercise