Add setting $_configuration['allow_teacher_access_student_skills']

Allow teachers to access student skills BT#14161,
skills setting must be enabled in the platform.
pull/2467/head
jmontoyaa 8 years ago
parent e1e590fef5
commit e67e735576
  1. 11
      main/inc/lib/tracking.lib.php
  2. 19
      main/install/configuration.dist.php
  3. 8
      main/mySpace/myStudents.php

@ -6560,15 +6560,16 @@ class Tracking
/**
* Get the HTML code for show a block with the achieved user skill on course/session.
*
* @param int $userId
* @param int $courseId optional
* @param int $sessionId optional
* @param int $userId
* @param int $courseId
* @param int $sessionId
* @param bool $forceView forces the view of the skills, not checking for deeper access
*
* @return string
*/
public static function displayUserSkills($userId, $courseId = 0, $sessionId = 0)
public static function displayUserSkills($userId, $courseId = 0, $sessionId = 0, $forceView = false)
{
if (Skill::isAllowed($userId, false) === false) {
if (Skill::isAllowed($userId, false) === false && $forceView == false) {
return '';
}
$skillManager = new Skill();

@ -788,13 +788,6 @@ ALTER TABLE skill_rel_course ADD CONSTRAINT FK_E7CEC7FA613FECDF FOREIGN KEY (ses
// affect privacy protection.
//$_configuration['allow_user_message_tracking'] = false;
// ------ Custom DB changes
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes
// Add a portfolio tool (duplicating the Notebook tool). Requires DB changes:
/*
CREATE TABLE portfolio (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, c_id INT DEFAULT NULL, session_id INT DEFAULT NULL, category_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, creation_date DATETIME NOT NULL, update_date DATETIME NOT NULL, is_visible TINYINT(1) DEFAULT '1' NOT NULL, INDEX user (user_id), INDEX course (c_id), INDEX session (session_id), INDEX category (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
@ -808,5 +801,15 @@ INSERT INTO settings_current(variable, subkey, type, category, selected_value, t
*/
//$_configuration['allow_portfolio_tool'] = false;
// Disable average and best columns in gradebook see BT#
// Disable average and best columns in gradebook see BT#14126
//$_configuration['disable_gradebook_stats'] = false;
// Allow teachers to access student skills BT#14161 (skills setting must be enabled in the platform)
//$_configuration['allow_teacher_access_student_skills'] = false;
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes

@ -893,13 +893,13 @@ if (empty($details)) {
$progress = Tracking::get_avg_student_progress(
$user_info['user_id'],
$courseCodeItem,
null,
[],
$sId
);
$score = Tracking:: get_avg_student_score(
$user_info['user_id'],
$courseCodeItem,
null,
[],
$sId
);
$progress = empty($progress) ? '0%' : $progress.'%';
@ -1603,10 +1603,12 @@ if (empty($details)) {
</div>
<?php
} //end details
echo Tracking::displayUserSkills(
$user_info['user_id'],
$courseInfo ? $courseInfo['real_id'] : 0,
$sessionId
$sessionId,
api_get_configuration_value('allow_teacher_access_student_skills')
);
if ($allowMessages === true) {

Loading…
Cancel
Save