Code Duplication    Length = 9-10 lines in 2 locations

main/exercice/export/scorm/scorm_classes.php 1 location

@@ 921-929 (lines=9) @@
918
     * @param boolean $standalone Wether it should include XML tag and DTD line.
919
     * @return string XML as a string, or an empty string if there's no exercise with given ID.
920
     */
921
    public static function export_exercise_to_scorm($exerciseId, $standalone=true) {
922
        $exercise = new Exercise();
923
        if (! $exercise->read($exerciseId)) {
924
            return '';
925
        }
926
        $ims = new ScormSection($exercise);
927
        $xml = $ims->export($standalone);
928
        return $xml;
929
    }
930
931
932
    /**

main/exercice/export/qti2/qti2_export.php 1 location

@@ 424-433 (lines=10) @@
421
 * @param boolean $standalone Wether it should include XML tag and DTD line.
422
 * @return string XML as a string, or an empty string if there's no exercise with given ID.
423
 */
424
function export_exercise_to_qti($exerciseId, $standalone = true)
425
{
426
    $exercise = new Exercise();
427
    if (!$exercise->read($exerciseId)) {
428
        return '';
429
    }
430
    $ims = new ImsSection($exercise);
431
    $xml = $ims->export($standalone);
432
    return $xml;
433
}
434
435
/**
436
 * Returns the XML flow corresponding to one question