Code Duplication    Length = 9-12 lines in 2 locations

main/survey/survey.lib.php 2 locations

@@ 3370-3381 (lines=12) @@
3367
        echo get_lang('SelectXAxis').': ';
3368
        echo '<select name="xaxis">';
3369
        echo '<option value="">---</option>';
3370
        foreach ($questions as $key => & $question) {
3371
            if (is_array($allowed_question_types)) {
3372
                if (in_array($question['type'], $allowed_question_types)) {
3373
                    echo '<option value="'.$question['question_id'].'"';
3374
                    if (isset($_GET['xaxis']) && $_GET['xaxis'] == $question['question_id']) {
3375
                        echo ' selected="selected"';
3376
                    }
3377
                    echo '">'.api_substr(strip_tags($question['question']), 0, 50).'</option>';
3378
                }
3379
            }
3380
3381
        }
3382
        echo '</select><br /><br />';
3383
        // Y axis
3384
        echo get_lang('SelectYAxis').': ';
@@ 3387-3395 (lines=9) @@
3384
        echo get_lang('SelectYAxis').': ';
3385
        echo '<select name="yaxis">';
3386
        echo '<option value="">---</option>';
3387
        foreach ($questions as $key => &$question) {
3388
            if (in_array($question['type'], $allowed_question_types)) {
3389
                echo '<option value="'.$question['question_id'].'"';
3390
                if (isset($_GET['yaxis']) && $_GET['yaxis'] == $question['question_id']) {
3391
                    echo ' selected="selected"';
3392
                }
3393
                echo '">'.api_substr(strip_tags($question['question']), 0, 50).'</option>';
3394
            }
3395
        }
3396
        echo '</select><br /><br />';
3397
        echo '<button class="save" type="submit" name="Submit" value="Submit">'.get_lang('CompareQuestions').'</button>';
3398
        echo '</form>';