* Add an activity to the matrix when it's duplicated (if the new one is linked to competencies). Moodle automatically add the corresponding competencies to the new activity, so we just have to check that to add it to the matrix if necessary
* @param int $moduleid
*/
functionduplicate_matrix_competencies($moduleid){
global$DB;
$sql="SELECT mc.cmid, m.section FROM {competency_modulecomp} mc JOIN {course_modules} m ON mc.cmid=m.id WHERE mc.cmid= :moduleid";