Code Duplication    Length = 7-15 lines in 2 locations

main/survey/survey.lib.php 1 location

@@ 2992-2998 (lines=7) @@
2989
            $return .= '-;'; // The user column
2990
        }
2991
2992
        if ($display_extra_user_fields) {
2993
            // Show user fields data, if any, for this user
2994
            $user_fields_values = UserManager::get_extra_user_data($user,false,false, false, true);
2995
            foreach ($user_fields_values as & $value) {
2996
                $return .= '"'.str_replace('"', '""', api_html_entity_decode(strip_tags($value), ENT_QUOTES)).'";';
2997
            }
2998
        }
2999
3000
        if (is_array($possible_options)) {
3001
            foreach ($possible_options as $question_id => $possible_option) {

main/exercise/exercise_result.class.php 1 location

@@ 379-393 (lines=15) @@
376
            $data .= str_replace("\r\n",'  ',api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';';
377
            $data .= str_replace("\r\n",'  ',implode(", ", GroupManager :: get_user_group_name($row['user_id']))).';';
378
379
            if ($export_user_fields) {
380
                //show user fields data, if any, for this user
381
                $user_fields_values = UserManager::get_extra_user_data(
382
                    $row['user_id'],
383
                    false,
384
                    false,
385
                    false,
386
                    true
387
                );
388
                if (!empty($user_fields_values)) {
389
                    foreach($user_fields_values as $value) {
390
                        $data .= '"'.str_replace('"','""',api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)).'";';
391
                    }
392
                }
393
            }
394
395
            $data .= str_replace("\r\n",'  ', api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';';
396
            $data .= str_replace("\r\n", '  ', $row['start_date']).';';