Disabling code in Gradebook that is useless due the changes of the funcionality of this tool.: "Gradebook tab" was moved in order to be added as a tool in a Course see issue #2705

skala
Julio Montoya 14 years ago
parent 950e1e8f28
commit 071dddab45
  1. 3
      main/gradebook/gradebook_add_eval.php
  2. 5
      main/gradebook/gradebook_add_user.php
  3. 13
      main/gradebook/lib/be/dropboxlink.class.php
  4. 12
      main/gradebook/lib/be/studentpublicationlink.class.php
  5. 6
      main/gradebook/lib/fe/displaygradebook.php
  6. 6
      main/gradebook/open_document.php

@ -43,7 +43,8 @@ if ($form->validate()) {
$eval->add();
if ($eval->get_course_code() == null) {
if ($values['adduser'] == 1) {
header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id());
//Disabling code when course code is null see issue #2705
//header('Location: gradebook_add_user.php?selecteval=' . $eval->get_id());
exit;
} else {
header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $eval->get_category_id());

@ -2,6 +2,11 @@
/* For licensing terms, see /license.txt */
//Disabling code when course code is null (gradebook as a tab) see issue #2705
exit;
$language_file = 'gradebook';
require_once '../inc/global.inc.php';
$this_section = SECTION_MYGRADEBOOK;

@ -19,12 +19,16 @@ class DropboxLink extends EvalLink
}
// FUNCTIONS IMPLEMENTING ABSTRACTLINK
/**
*
* Returns the URL of a document
* This funcion is loaded when using a gradebook as a tab (gradebook = -1) see issue #2705
*/
public function get_view_url ($stud_id) {
// find a file uploaded by the given student,
// with the same title as the evaluation name
$eval = $this->get_evaluation();
$sql = 'SELECT filename FROM '.$this->get_dropbox_table()
@ -34,8 +38,9 @@ class DropboxLink extends EvalLink
$result = Database::query($sql);
if ($fileurl = Database::fetch_row($result)) {
$course_info = Database :: get_course_info($this->get_course_code());
$url = api_get_path(WEB_PATH).'main/gradebook/open_document.php?file='.$course_info['directory'].'/'.$fileurl[0];
return $url;
//$url = api_get_path(WEB_PATH).'main/gradebook/open_document.php?file='.$course_info['directory'].'/'.$fileurl[0];
//return $url;
return null;
} else {
return null;
}

@ -21,7 +21,12 @@ class StudentPublicationLink extends AbstractLink
}
// FUNCTIONS IMPLEMENTING ABSTRACTLINK
/**
*
* Returns the URL of a document
* This funcion is loaded when using a gradebook as a tab (gradebook = -1), see issue #2705
*
*/
public function get_view_url ($stud_id) {
// find a file uploaded by the given student,
@ -39,8 +44,9 @@ class StudentPublicationLink extends AbstractLink
$result = Database::query($sql);
if ($fileurl = Database::fetch_row($result)) {
$course_info = Database :: get_course_info($this->get_course_code());
$url = api_get_path(WEB_PATH).'main/gradebook/open_document.php?file='.$course_info['directory'].'/'.$fileurl[0];
return $url;
//$url = api_get_path(WEB_PATH).'main/gradebook/open_document.php?file='.$course_info['directory'].'/'.$fileurl[0];
//return $url;
return null;
} else {
return null;
}

@ -15,9 +15,9 @@ class DisplayGradebook
$header = '<div class="actions">';
$header .= '<a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat=' . $selectcat . '">'. Display::return_icon(('back.png'),get_lang('FolderView')) . get_lang('FolderView') . '</a>';
if ($evalobj->get_course_code() == null) {
$header .= '<a href="gradebook_add_user.php?selecteval=' . $evalobj->get_id() . '"><img src="../img/add_user_big.gif" alt="' . get_lang('AddStudent') . '" align="absmiddle" /> ' . get_lang('AddStudent') . '</a>';
}
elseif (!$evalobj->has_results()) {
//Disabling code when course code is null see issue #2705
//$header .= '<a href="gradebook_add_user.php?selecteval=' . $evalobj->get_id() . '"><img src="../img/add_user_big.gif" alt="' . get_lang('AddStudent') . '" align="absmiddle" /> ' . get_lang('AddStudent') . '</a>';
} elseif (!$evalobj->has_results()) {
$header .= '<a href="gradebook_add_result.php?selectcat=' . $selectcat . '&selecteval=' . $evalobj->get_id() . '"><img src="../img/filenew.gif" alt="' . get_lang('AddResult') . '" align="absmiddle"/> ' . get_lang('AddResult') . '</a>';
}
$header .= '<a href="' . api_get_self() . '?&selecteval=' . $evalobj->get_id() . '&import="><img src="../img/import_data.gif" border="0" alt="" />' . ' ' . get_lang('ImportResult') . '</a>';

@ -1,7 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
//Disabling code due issue #2705 gradebook with id "-1"
exit;
/*
require_once '../inc/global.inc.php';
require_once '../inc/lib/document.lib.php';
api_block_anonymous_users();
DocumentManager :: file_send_for_download(api_get_path(SYS_COURSE_PATH).$_GET['file']);
exit;
exit;
*/
Loading…
Cancel
Save