|
|
|
@ -2471,16 +2471,29 @@ class SurveyManager |
|
|
|
|
$classTag = '{{class_name}}'; |
|
|
|
|
$studentTag = '{{student_full_name}}'; |
|
|
|
|
$classCounter = 0; |
|
|
|
|
|
|
|
|
|
$newQuestionList = []; |
|
|
|
|
foreach ($questions as $question) { |
|
|
|
|
$newQuestionList[$question['sort']] = $question; |
|
|
|
|
} |
|
|
|
|
ksort($newQuestionList); |
|
|
|
|
|
|
|
|
|
$order = api_get_configuration_value('survey_duplicate_order_by_name'); |
|
|
|
|
foreach ($itemList as $class) { |
|
|
|
|
$className = $class['name']; |
|
|
|
|
$users = $class['users']; |
|
|
|
|
$userInfoList = []; |
|
|
|
|
foreach ($users as $userId) { |
|
|
|
|
$userInfoList[] = api_get_user_info($userId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($order) { |
|
|
|
|
usort( |
|
|
|
|
$userInfoList, |
|
|
|
|
function ($a, $b) { |
|
|
|
|
return $a['lastname'] > $b['lastname']; |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach ($newQuestionList as $question) { |
|
|
|
|
$text = $question['question']; |
|
|
|
@ -2503,8 +2516,7 @@ class SurveyManager |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach ($users as $userId) { |
|
|
|
|
$userInfo = api_get_user_info($userId); |
|
|
|
|
foreach ($userInfoList as $userInfo) { |
|
|
|
|
if (false !== strpos($text, $studentTag)) { |
|
|
|
|
$replacedText = str_replace($studentTag, $userInfo['complete_name'], $text); |
|
|
|
|
$values = [ |
|
|
|
|