chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
784 stars 478 forks source link

C2 : Survey in LP : enable student to access #5713

Open NicoDucou opened 1 month ago

NicoDucou commented 1 month ago

In Chamilo Master you can include a survey in a LP. When including a survey in a LP the student automatically gain access to the survey because it is included in the learning path no need to have an invitation. In Chamilo Master on the 2024/08/07 we can include a survey in a LP but the student does not have access it is indicated "Protected document". So it needs to be reimplemented in master to enable a student to access a survey in the LP. And if the course is included in a session then the student in the session that are in the LP need to be able to do the survey as well.

In Chamilo 1.11.x it was implemented with this option :

// Allow survey tool in learnpath
// ALTER TABLE c_survey_answer ADD COLUMN c_lp_item_id INT DEFAULT 0;
// Edit src/Chamilo/CourseBundle/Entity/CSurveyAnswer.php and add a '' character in front of 'ORM\Column(name="c_lp_item_id"
// ALTER TABLE c_survey_invitation ADD COLUMN c_lp_item_id int(11) DEFAULT 0;
// Edit src/Chamilo/CourseBundle/Entity/CSurveyInvitation.php and add a '' character in front of 'ORM\Column(name="c_lp_item_id"
//$_configuration['allow_survey_tool_in_lp'] = false;
christianbeeznest commented 3 weeks ago

Hi @NicoDucou ,

The required fields have been added to the entities for those tables, and the default setting is now to show surveys in lessons. Therefore, the allow_survey_tool_in_lp option is no longer used in Chamilo 2, and it has been removed in the migration file Version20240423101010:

NicoDucou commented 3 weeks ago

Hi @christianbeeznest Thank you for the indication. Indeed the option "allow_survey_tool_in_lp" is not necessary anymore but the survey should be accessible for the student if it is in a LP. For the moment the student gets an indication of "Protected document".

The way it should work is if a survey is included in a LP then the user should have access to it no need to be invited. And if the course is included in a session then the student in the session that are in the LP need to be able to do the survey as well.

NicoDucou commented 3 weeks ago

It can be reproduced in the LP here : https://testing24.beeznest.com/main/lp/lp_controller.php?cid=1&sid=0&gid=0&gradebook=0&origin=&action=view&lp_id=1

christianbeeznest commented 2 weeks ago

Hi @NicoDucou ,

It is added in this PR https://github.com/chamilo/chamilo-lms/pull/5766

Thanks for confirmation.