Skip to content
Permalink
Browse files

Add config 'block_student_publication_score_edition' BT#14987

Teachers can't edit student score once the score was set.
Admins can still edit those values
  • Loading branch information...
jmontoyaa committed Oct 22, 2018
1 parent e965b5d commit 54a8d0d0a5f5670867dd8f52685cae1b43caae5b
Showing with 25 additions and 5 deletions.
  1. +11 −0 main/work/view.php
  2. +14 −5 main/work/work.lib.php
@@ -28,6 +28,12 @@
$my_folder_data = get_work_data_by_id($work['parent_id']);
$courseInfo = api_get_course_info();
$blockScoreEdition = api_get_configuration_value('block_student_publication_score_edition');
if ($blockScoreEdition && !empty($work['qualification']) && !api_is_platform_admin()) {
api_not_allowed(true);
}
protectWork(api_get_course_info(), $work['parent_id']);
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
@@ -130,6 +136,11 @@
}
}
$blockScoreEdition = api_get_configuration_value('block_student_publication_score_edition');
if ($blockScoreEdition && !api_is_platform_admin()) {
$url = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$my_folder_data['id'];
}
header('Location: '.$url);
exit;
break;
@@ -1938,6 +1938,7 @@ function get_work_user_list(
);
$blockEdition = api_get_configuration_value('block_student_publication_edition');
$blockScoreEdition = api_get_configuration_value('block_student_publication_score_edition');
while ($work = Database::fetch_array($result, 'ASSOC')) {
$item_id = $work['id'];
@@ -2022,8 +2023,12 @@ function get_work_user_list(
if ($qualification_exists) {
$feedback .= ' ';
}
$feedback .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
$count.' '.Display::returnFontAwesomeIcon('comments-o').'</a> ';
$feedback .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang(
'View'
).'">'.
$count.' '.Display::returnFontAwesomeIcon('comments-o').'</a> ';
}
$correction = '';
@@ -2056,9 +2061,13 @@ function get_work_user_list(
// Actions.
$action = '';
if (api_is_allowed_to_edit()) {
$action .= '<a
href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'"
title="'.get_lang('View').'">'.$rateIcon.'</a> ';
if ($blockScoreEdition && !api_is_platform_admin() && !empty($work['qualification_score'])) {
$rateLink = '';
} else {
$rateLink = '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
$rateIcon.'</a> ';
}
$action .= $rateLink;
if ($unoconv && empty($work['contains_file'])) {
$action .= '<a f

0 comments on commit 54a8d0d

Please sign in to comment.
You can’t perform that action at this time.