Showing user result in the gradebook_statistics.php page + replacing api_is_allowed_to_create_course() with api_is_allowed_to_edit() with the first one a teacher that's subscribed like an student to the course has teacher permissions!! see BT#3254

skala
Julio Montoya 14 years ago
parent 4164a7849d
commit 4b66191080
  1. 6
      main/gradebook/gradebook.php
  2. 3
      main/gradebook/gradebook_display_certificate.php
  3. 2
      main/gradebook/gradebook_edit_all.php
  4. 6
      main/gradebook/gradebook_statistics.php
  5. 13
      main/gradebook/gradebook_view_result.php
  6. 7
      main/gradebook/index.php
  7. 2
      main/gradebook/lib/be/abstractlink.class.php
  8. 26
      main/gradebook/lib/be/category.class.php
  9. 2
      main/gradebook/lib/be/evallink.class.php
  10. 4
      main/gradebook/lib/be/evaluation.class.php
  11. 2
      main/gradebook/lib/be/exerciselink.class.php
  12. 2
      main/gradebook/lib/be/learnpathlink.class.php
  13. 2
      main/gradebook/lib/be/surveylink.class.php
  14. 28
      main/gradebook/lib/fe/displaygradebook.php
  15. 20
      main/gradebook/lib/fe/gradebooktable.class.php
  16. 2
      main/gradebook/lib/gradebook_data_generator.class.php
  17. 6
      main/gradebook/lib/gradebook_functions.inc.php
  18. 2
      main/gradebook/lib/gradebook_functions_users.inc.php
  19. 10
      main/gradebook/lib/scoredisplay.class.php

@ -470,7 +470,7 @@ if (isset ($move_form)) {
}
// LOAD DATA & DISPLAY TABLE -
$is_platform_admin= api_is_platform_admin();
$is_course_admin= api_is_allowed_to_create_course();
$is_course_admin= api_is_allowed_to_edit();
//load data for category, evaluation and links
if (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) {
$category= 0;
@ -505,7 +505,7 @@ if (!empty($keyword)) {
} elseif (isset ($_GET['studentoverview'])) {
//@todo this code seems to be deprecated because the gradebook tab is off
$cats= Category :: load($category);
$stud_id= (api_is_allowed_to_create_course() ? null : api_get_user_id());
$stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id());
$allcat= array ();
$alleval= $cats[0]->get_evaluations($stud_id, true);
$alllink= $cats[0]->get_links($stud_id, true);
@ -576,7 +576,7 @@ if (!empty($keyword)) {
exit;
} else {
$cats= Category :: load($category);
$stud_id= (api_is_allowed_to_create_course() ? null : api_get_user_id());
$stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id());
$allcat= $cats[0]->get_subcategories($stud_id);
$alleval= $cats[0]->get_evaluations($stud_id);
$alllink= $cats[0]->get_links($stud_id);

@ -62,9 +62,8 @@ echo Display::tag('h3', get_lang('GradebookListOfStudentsCertificates'));
if (!empty($cats)) {
//with this fix the teacher only can view 1 gradebook
//$stud_id= (api_is_allowed_to_create_course() ? null : api_get_user_id());
if (api_is_platform_admin()) {
$stud_id= (api_is_allowed_to_create_course() ? null : api_get_user_id());
$stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id());
} else {
$stud_id= api_get_user_id();
}

@ -25,7 +25,7 @@ require_once 'lib/fe/displaygradebook.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
api_block_anonymous_users();
if (!api_is_allowed_to_create_course()) {
if (!api_is_allowed_to_edit()) {
header('Location: /index.php');
exit;
}

@ -31,7 +31,7 @@ if ($eval[0]->get_category_id() < 0) {
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook'));
if (api_is_allowed_to_create_course()){
if (api_is_allowed_to_edit()) {
$interbreadcrumb[]= array (
'url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']),
'name' => get_lang('ViewResult'
@ -41,11 +41,13 @@ $displayscore = ScoreDisplay :: instance();
Display::display_header(get_lang('EvaluationStatistics'));
DisplayGradebook::display_header_result($eval[0], $currentcat[0]->get_id(), 0, 'statistics');
if (!$displayscore->is_custom()) {
if (api_is_platform_admin() || api_is_course_admin()) {
Display :: display_error_message(get_lang('PleaseEnableScoringSystem'),false);
}
} else {
//Bad, Regular, Good - User definitions
$displays = $displayscore->get_custom_score_display_settings();
@ -80,7 +82,7 @@ if (!$displayscore->is_custom()) {
// generate table
$stattable= '<br><table class="data_table" cellspacing="0" cellpadding="3">';
$stattable= '<table class="data_table" cellspacing="0" cellpadding="3">';
$stattable .= '<tr><th colspan="4">' . get_lang('Statistics') . '</th></tr>';
$counter=0;
foreach ($keys as $key) {

@ -28,11 +28,8 @@ require_once api_get_path(LIBRARY_PATH).'ezpdf/class.ezpdf.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
api_block_anonymous_users();
block_students();
if (!api_is_drh()){
block_students();
}
block_students();
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'],
@ -44,6 +41,7 @@ $select_eval=Security::remove_XSS($_GET['selecteval']);
if (empty($select_eval)) {
api_not_allowed();
}
$displayscore = Scoredisplay :: instance();
$eval= Evaluation :: load($select_eval);
$overwritescore= 0;
@ -91,6 +89,7 @@ if (isset ($_GET['editres'])) {
exit;
}
}
if (isset ($_GET['import'])) {
$interbreadcrumb[]= array ('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult'));
$import_result_form = new DataForm(DataForm :: TYPE_IMPORT, 'import_result_form', null, api_get_self() . '?import=&selecteval=' . Security::remove_XSS($_GET['selecteval']), '_blank', '');
@ -180,7 +179,8 @@ if (isset ($_GET['import'])) {
exit;
}
}
if (isset ($_GET['export'])) {
if (isset($_GET['export'])) {
$interbreadcrumb[]= array ('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']),'name' => get_lang('ViewResult'));
$locked_status = $eval[0]->get_locked();
$export_result_form= new DataForm(DataForm :: TYPE_EXPORT, 'export_result_form', null, api_get_self() . '?export=&selecteval=' . $_GET['selecteval'], '_blank', $locked_status);
@ -377,7 +377,8 @@ if (isset ($_GET['print'])) {
} else {
$resulttable= new ResultTable($eval[0], $allresults, $iscourse, $addparams);
}
$htmlHeadXtra[]= '<script type="text/javascript">
$htmlHeadXtra[]= '<script type="text/javascript">
function confirmationuser() {
if (confirm("' . get_lang('DeleteUser') . '?"))

@ -541,7 +541,7 @@ if (isset ($move_form)){
// LOAD DATA & DISPLAY TABLE
$is_platform_admin = api_is_platform_admin();
$is_course_admin = api_is_allowed_to_edit(null, true);// api_is_allowed_to_create_course();
$is_course_admin = api_is_allowed_to_edit(null, true);
//load data for category, evaluation and links
if (empty ($_GET['selectcat'])) {
@ -575,7 +575,7 @@ else
if (isset ($_GET['studentoverview'])) {
//@todo this code also seems to be deprecated ...
$cats= Category :: load($category);
$stud_id= (api_is_allowed_to_create_course() ? null : $stud_id);
$stud_id= (api_is_allowed_to_edit() ? null : $stud_id);
$allcat= array ();
$alleval= $cats[0]->get_evaluations($stud_id, true);
$alllink= $cats[0]->get_links($stud_id, true);
@ -652,9 +652,8 @@ if (isset ($_GET['studentoverview'])) {
$cats = Category :: load ($category, null, null, null, null, null, false);
//with this fix the teacher only can view 1 gradebook
//$stud_id= (api_is_allowed_to_create_course() ? null : api_get_user_id());
if (api_is_platform_admin()) {
$stud_id = (api_is_allowed_to_create_course() ? null : api_get_user_id());
$stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id());
} else {
$stud_id = $stud_id;
}

@ -340,7 +340,7 @@ abstract class AbstractLink implements GradebookItem {
*/
public function find_links ($name_mask,$selectcat) {
$rootcat = Category::load($selectcat);
$links = $rootcat[0]->get_links((api_is_allowed_to_create_course() ? null : api_get_user_id()), true);
$links = $rootcat[0]->get_links((api_is_allowed_to_edit() ? null : api_get_user_id()), true);
$foundlinks = array();
foreach ($links as $link) {
if (!(api_strpos(api_strtolower($link->get_name()), api_strtolower($name_mask)) === false)) {

@ -415,7 +415,7 @@ class Category implements GradebookItem
.' FROM '.$tbl_grade_categories
." WHERE name = '".Database::escape_string($name)."'";
if (api_is_allowed_to_create_course()) {
if (api_is_allowed_to_edit()) {
$parent = Category::load($parent);
$code = $parent[0]->get_course_code();
if (isset($code) && $code != '0') {
@ -584,7 +584,7 @@ class Category implements GradebookItem
$sql = 'SELECT *'
.' FROM '.$tbl_grade_categories
.' WHERE parent_id = 0';
if (!api_is_allowed_to_create_course()) {
if (!api_is_allowed_to_edit()) {
$sql .= ' AND visible = 1';
//proceed with checks on optional parameters course & session
if (!empty($course_code)) {
@ -607,7 +607,7 @@ class Category implements GradebookItem
.' AND status = '.STUDENT
.')';
}
} elseif (api_is_allowed_to_create_course() && !api_is_platform_admin()) {
} elseif (api_is_allowed_to_edit() && !api_is_platform_admin()) {
//proceed with checks on optional parameters course & session
if (!empty($course_code)) {
// TODO: considering it highly improbable that a user would get here
@ -822,7 +822,7 @@ class Category implements GradebookItem
$targets[] = $root;
// course or platform admin
if (api_is_allowed_to_create_course()) {
if (api_is_allowed_to_edit()) {
$user = (api_is_platform_admin() ? null : api_get_user_id());
$cats = Category::get_root_categories_for_teacher($user);
@ -951,7 +951,7 @@ class Category implements GradebookItem
return true;
} else {
$cats = Category::load(null, null, null, $this->id,
api_is_allowed_to_create_course() ? null : 1);
api_is_allowed_to_edit() ? null : 1);
foreach ($cats as $cat) {
if ($cat->has_evaluations_with_results_for_student ($stud_id)) {
return true;
@ -970,10 +970,10 @@ class Category implements GradebookItem
* @param $cats optional: if defined, the categories will be added to this array
*/
public function get_independent_categories_with_result_for_student ($cat_id, $stud_id, $cats = array()) {
$creator = (api_is_allowed_to_create_course() && !api_is_platform_admin()) ? api_get_user_id() : null;
$creator = (api_is_allowed_to_edit() && !api_is_platform_admin()) ? api_get_user_id() : null;
$crsindcats = Category::load(null,$creator,'0',$cat_id,
api_is_allowed_to_create_course() ? null : 1);
api_is_allowed_to_edit() ? null : 1);
if (!empty($crsindcats)) {
foreach ($crsindcats as $crsindcat) {
@ -1010,11 +1010,11 @@ class Category implements GradebookItem
return Category::get_root_categories_for_student ($stud_id, $course_code, $session_id);
} else {
return Category::load(null,null, $course_code, $this->id, api_is_allowed_to_create_course() ? null : 1, $session_id );
return Category::load(null,null, $course_code, $this->id, api_is_allowed_to_edit() ? null : 1, $session_id );
}
} else {// all students
// course admin
if (api_is_allowed_to_create_course() && !api_is_platform_admin()) {
if (api_is_allowed_to_edit() && !api_is_platform_admin()) {
// root
if ($this->id == 0) {
return $this->get_root_categories_for_teacher(api_get_user_id(), $course_code, $session_id, false);
@ -1055,12 +1055,12 @@ class Category implements GradebookItem
if ($this->id == 0) {
$evals = Evaluation::get_evaluations_with_result_for_student(0,$stud_id);
} else {
$evals = Evaluation::load(null,null,$course_code,$this->id, api_is_allowed_to_create_course() ? null : 1);
$evals = Evaluation::load(null,null,$course_code,$this->id, api_is_allowed_to_edit() ? null : 1);
}
} else {// all students
// course admin
if ((api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) && !api_is_platform_admin()) {
if ((api_is_allowed_to_edit() || api_is_drh() || api_is_session_admin()) && !api_is_platform_admin()) {
// root
if ($this->id == 0) {
$evals = Evaluation::load(null, api_get_user_id(), null, $this->id, null);
@ -1115,10 +1115,10 @@ class Category implements GradebookItem
// 1 student $stud_id
elseif (isset($stud_id)) {
$links = LinkFactory::load(null,null,null,null,empty($this->course_code)?null:$course_code,$this->id,
api_is_allowed_to_create_course() ? null : 1);
api_is_allowed_to_edit() ? null : 1);
}
// all students -> only for course/platform admin
elseif (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) {
elseif (api_is_allowed_to_edit() || api_is_drh() || api_is_session_admin()) {
$links = LinkFactory::load(null,null,null,null,empty($this->course_code)?null:$this->course_code,$this->id, null);
}

@ -35,7 +35,7 @@ abstract class EvalLink extends AbstractLink
public function get_link() {
$eval = $this->get_evaluation();
// course/platform admin can go to the view_results page
if (api_is_allowed_to_create_course())
if (api_is_allowed_to_edit())
return 'gradebook_view_result.php?selecteval=' . $eval->get_id();
// students can go to the statistics page (if custom display enabled)
elseif (ScoreDisplay :: instance()->is_custom())

@ -340,7 +340,7 @@ class Evaluation implements GradebookItem
.' FROM '.$tbl_grade_evaluations
." WHERE name = '".Database::escape_string($name)."'";
if (api_is_allowed_to_create_course()) {
if (api_is_allowed_to_edit()) {
$parent = Category::load($parent);
$code = $parent[0]->get_course_code();
if (isset($code) && $code != '0') {
@ -517,7 +517,7 @@ class Evaluation implements GradebookItem
.' WHERE id IN'
.'(SELECT evaluation_id FROM '.$tbl_grade_results
.' WHERE user_id = '.intval($stud_id).' AND score IS NOT NULL)';
if (!api_is_allowed_to_create_course()) {
if (!api_is_allowed_to_edit()) {
$sql .= ' AND visible = 1';
}
if (isset($cat_id)) {

@ -148,7 +148,7 @@ class ExerciseLink extends AbstractLink
$course_code=$this->get_course_code();
$status_user=api_get_status_of_user_in_course ($user_id,$course_code);
$url = api_get_path(WEB_PATH).'main/gradebook/exercise_jump.php?cidReq='.$this->get_course_code().'&gradebook=view&exerciseId='.$this->get_ref_id();
if ((!api_is_allowed_to_create_course() && $this->calc_score(api_get_user_id()) == null) || $status_user!=1) {
if ((!api_is_allowed_to_edit() && $this->calc_score(api_get_user_id()) == null) || $status_user!=1) {
$url .= '&amp;doexercise='.$this->get_ref_id();
}
return $url;

@ -139,7 +139,7 @@ class LearnpathLink extends AbstractLink
{
$url = api_get_path(WEB_PATH)
.'main/newscorm/lp_controller.php?cidReq='.$this->get_course_code().'&gradebook=view';
if (!api_is_allowed_to_create_course()
if (!api_is_allowed_to_edit()
|| $this->calc_score(api_get_user_id()) == null)
{
$url .= '&action=view&lp_id='.$this->get_ref_id();

@ -188,7 +188,7 @@ class SurveyLink extends AbstractLink
}
public function get_link() {
if (api_is_allowed_to_create_course()) { // Let students make access only through "Surveys" tool.
if (api_is_allowed_to_edit()) { // Let students make access only through "Surveys" tool.
$tbl_name = $this->get_survey_table();
$session_id = api_get_session_id();
if ($tbl_name != '') {

@ -18,7 +18,6 @@ class DisplayGradebook
* @param $forpdf only output for pdf file
*/
function display_header_result($evalobj, $selectcat, $page) {
$status = CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id());
if (api_is_allowed_to_edit(null, true)) {
$header = '<div class="actions">';
@ -36,7 +35,6 @@ class DisplayGradebook
if ($evalobj->has_results()) {
$header .= '<a href="' . api_get_self() . '?&selecteval=' . $evalobj->get_id() . '&export=">'.Display::return_icon('export_evaluation.png',get_lang('ExportResult'),'','32') . '</a>';
$header .= '<a href="gradebook_edit_result.php?selecteval=' . $evalobj->get_id() .'">'.Display::return_icon('edit.png',get_lang('EditResult'),'','32').'</a>';
$header .= '<a href="' . api_get_self() . '?&selecteval=' . $evalobj->get_id() . '&deleteall=" onclick="return confirmationall();">'.Display::return_icon('delete.png',get_lang('DeleteResult'),'','32').'</a>';
}
@ -46,6 +44,7 @@ class DisplayGradebook
}
$header .= '</div>';
}
if ($evalobj->is_visible() == '1') {
$visible= get_lang('Yes');
} else {
@ -53,16 +52,23 @@ class DisplayGradebook
}
$scoredisplay = ScoreDisplay :: instance();
$student_score = '';
if (($evalobj->has_results())){ // TODO this check needed ?
$score = $evalobj->calc_score();
if ($score != null)
$average= get_lang('Average') . ' :<b> ' .$scoredisplay->display_score($score, SCORE_AVERAGE) . '</b>';
if ($score != null) {
$average= get_lang('Average') . ' :<b> ' .$scoredisplay->display_score($score, SCORE_AVERAGE) . '</b>';
$student_score = $evalobj->calc_score(api_get_user_id());
$student_score = Display::tag('h3', get_lang('Result').': '.$scoredisplay->display_score($student_score, SCORE_DIV_PERCENT));
}
}
if (!$evalobj->get_description() == '') {
$description= get_lang('Description') . ' :<b> ' . $evalobj->get_description() . '</b><br>';
}
if ($evalobj->get_course_code() == null) {
$course= get_lang('CourseIndependent');
} else {
@ -70,12 +76,18 @@ class DisplayGradebook
}
$evalinfo= '<table width="100%" border="0"><tr><td>';
$evalinfo .= '<h2>'.$evalobj->get_name().'</h2><br />';
$evalinfo .= '<h2>'.$evalobj->get_name().'</h2>';
$evalinfo .= $description;
$evalinfo .= get_lang('Course') . ' :<b> ' . $course . '</b><br />';
//'<br>' . get_lang('Weight') . ' :<b> ' . $evalobj->get_weight() . '</b><br>' . get_lang('Visible') . ' :<b> ' . $visible . '</b>
$evalinfo .= get_lang('QualificationNumeric') . ' :<b> ' . $evalobj->get_max() . '</b><br>'.$average;
if (!api_is_allowed_to_edit()) {
$evalinfo .= $student_score;
}
if (!$evalobj->has_results()) {
$evalinfo .= '<br /><i>' . get_lang('NoResultsInEvaluation') . '</i>';
} elseif ($scoredisplay->is_custom() && api_get_self() != '/main/gradebook/gradebook_statistics.php') {
@ -92,7 +104,7 @@ class DisplayGradebook
}
$evalinfo .= '</td><td><img style="float:right; position:relative;" src="../img/tutorial.gif"></img></td></table>';
Display :: display_normal_message($evalinfo,false);
echo $evalinfo;
echo $header;
}

@ -29,7 +29,7 @@ class GradebookTable extends SortableTable {
function GradebookTable ($currentcat, $cats = array(), $evals = array(), $links = array(), $addparams = null) {
$status = CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id());
parent :: __construct ('gradebooklist', null, null, (api_is_allowed_to_create_course()?1:0));
parent :: __construct ('gradebooklist', null, null, (api_is_allowed_to_edit()?1:0));
$this->evals_links = array_merge($evals, $links);
$this->currentcat = $currentcat;
@ -55,7 +55,7 @@ class GradebookTable extends SortableTable {
if (api_is_allowed_to_edit(null, true)) {
//$this->set_header($column++, get_lang('CreationDate'),true, 'width="100px"');
} elseif (($status<>1) && !api_is_allowed_to_create_course() && (!isset($_GET['selectcat']) || $_GET['selectcat']==0)) {
} elseif (($status<>1) && !api_is_allowed_to_edit() && (!isset($_GET['selectcat']) || $_GET['selectcat']==0)) {
//$this->set_header($column++, get_lang('Date'),true, 'width="100px"');
}
@ -68,7 +68,7 @@ class GradebookTable extends SortableTable {
'setvisible' => get_lang('SetVisible'),
'setinvisible' => get_lang('SetInvisible')));
} else {
if (empty($_GET['selectcat']) && !api_is_allowed_to_create_course()) {
if (empty($_GET['selectcat']) && !api_is_allowed_to_edit()) {
$this->set_header($column++, get_lang('Certificates'),false);
} else {
//$evals_links = array_merge($evals, $links);
@ -96,7 +96,7 @@ class GradebookTable extends SortableTable {
global $my_score_in_gradebook, $certificate_min_score;
$scoretotal = 0;
// determine sorting type
$col_adjust = (api_is_allowed_to_create_course() ? 1 : 0);
$col_adjust = (api_is_allowed_to_edit() ? 1 : 0);
switch ($this->column) {
// Type
case (0 + $col_adjust) :
@ -145,8 +145,8 @@ class GradebookTable extends SortableTable {
$id = $item->get_id();
//if the item is invisible, wrap it in a span with class invisible
$invisibility_span_open = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '<span class="invisible">' : '';
$invisibility_span_close = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '</span>' : '';
$invisibility_span_open = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '<span class="invisible">' : '';
$invisibility_span_close = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '</span>' : '';
if (api_is_allowed_to_edit(null, true)) {
$row[] = $this->build_id_column($item);
@ -224,8 +224,8 @@ class GradebookTable extends SortableTable {
$id = $item->get_id();
//if the item is invisible, wrap it in a span with class invisible
$invisibility_span_open = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '<span class="invisible">' : '';
$invisibility_span_close = (api_is_allowed_to_create_course() && $item->is_visible() == '0') ? '</span>' : '';
$invisibility_span_open = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '<span class="invisible">' : '';
$invisibility_span_close = (api_is_allowed_to_edit() && $item->is_visible() == '0') ? '</span>' : '';
if (api_is_allowed_to_edit(null, true)) {
$row[] = $this->build_id_column($item);
@ -421,7 +421,7 @@ class GradebookTable extends SortableTable {
// course/platform admin can go to the view_results page
if (api_is_allowed_to_create_course() && $show_message===false) {
if (api_is_allowed_to_edit() && $show_message===false) {
if ($item->get_type() == 'presence') {
return '&nbsp;'
. '<a href="gradebook_view_result.php?cidReq='.$course_id.'&amp;selecteval=' . $item->get_id() . '">'
@ -440,7 +440,7 @@ class GradebookTable extends SortableTable {
. $item->get_name()
. '</a>';
} elseif ($show_message===false && !api_is_allowed_to_create_course() && !(ScoreDisplay :: instance()->is_custom())) {
} elseif ($show_message===false && !api_is_allowed_to_edit() && !(ScoreDisplay :: instance()->is_custom())) {
return '&nbsp;'
. '<a href="gradebook_statistics.php?selecteval=' . $item->get_id() . '">'
. $item->get_name()

@ -96,7 +96,7 @@ class GradebookDataGenerator
//$row[] = $this->build_date_column($item);
}
if (count($this->evals_links) > 0) {
if (!api_is_allowed_to_create_course() || $status_user != 1 ) {
if (!api_is_allowed_to_edit() || $status_user != 1 ) {
$row[] = $this->build_result_column($item, $ignore_score_color);
}
}

@ -103,9 +103,9 @@ function add_resource_to_course_gradebook($course_code, $resource_type, $resourc
return true;
}
function block_students() {
if (!api_is_allowed_to_create_course()) {
require_once api_get_path(INCLUDE_PATH).'header.inc.php';
function block_students() {
//if (!api_is_allowed_to_create_course()) {
if (!api_is_allowed_to_edit()) {
api_not_allowed();
}
}

@ -97,7 +97,7 @@ function get_all_users ($evals = array(), $links = array()) {
*/
function find_students($mask= '') {
// students shouldn't be here // don't search if mask empty
if (!api_is_allowed_to_create_course() || empty ($mask)) {
if (!api_is_allowed_to_edit() || empty ($mask)) {
return null;
}
$mask = Database::escape_string($mask);

@ -218,11 +218,11 @@ class ScoreDisplay
$this->custom_display = $displays;
$this->custom_display_conv = $this->convert_displays($this->custom_display);
if (isset($category_id)) {
$category_id = intval($category_id);
} else {
$category_id = $this->get_current_gradebook_category_id();
}
if (isset($category_id)) {
$category_id = intval($category_id);
} else {
$category_id = $this->get_current_gradebook_category_id();
}
// remove previous settings
$tbl_display = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);

Loading…
Cancel
Save