Fixes bug: "Class 'Testcategory' not found" see #5130

skala
Julio Montoya 14 years ago
parent 377e384a2a
commit 2ea3fc3603
  1. 29
      main/exercice/export/scorm/scorm_classes.php
  2. 4
      main/exercice/export/scorm/scorm_export.php
  3. 2
      main/newscorm/learnpath.class.php
  4. 6
      main/newscorm/learnpath_functions.inc.php

@ -1,4 +1,4 @@
<?php // $Id: scorm_classes.php,v 1.2 2006/07/06 18:50:49 moosh Exp $
<?php
/* For licensing terms, see /license.txt */
/**
* @author Claro Team <cvs@claroline.net>
@ -9,17 +9,19 @@
* Code
*/
if ( count( get_included_files() ) == 1 ) die( '---' );
require_once(api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/question.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/answer.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/unique_answer.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/multiple_answer.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/multiple_answer_combination.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/fill_blanks.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/freeanswer.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/hotspot.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/matching.class.php');
require_once(api_get_path(SYS_CODE_PATH).'exercice/hotspot.class.php');
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/testcategory.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/question.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/answer.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/unique_answer.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/multiple_answer.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/multiple_answer_combination.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/fill_blanks.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/freeanswer.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotspot.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/matching.class.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotspot.class.php';
// answer types
define('UNIQUE_ANSWER', 1);
@ -785,5 +787,4 @@ class ScormAnswerHotspot extends Answer
$html = '<tr><td colspan="2">'.get_lang('ThisItemIsNotExportable').'</td></tr>';
return array($js,$html);
}
}
?>
}

@ -10,9 +10,7 @@ if ( count( get_included_files() ) == 1 ) die( '---' );
require dirname(__FILE__) . '/scorm_classes.php';
/*--------------------------------------------------------
Classes
--------------------------------------------------------*/
/* Classes */
// answer types
define(UNIQUE_ANSWER, 1);
define(MULTIPLE_ANSWER, 2);

@ -8520,7 +8520,7 @@ class learnpath {
$my_file_path = 'quiz_'.$item->get_id().'.html';
// Write the contents of the exported exercise into a (big) html file
// to later pack it into the exported SCORM. The file will be removed afterwards.
$contents = export_exercise($exe_id,true);
$contents = export_exercise($exe_id, true);
$tmp_file_path = $archive_path.$temp_dir_short.'/'.$my_file_path;
$res = file_put_contents($tmp_file_path, $contents);
if ($res === false) { error_log('Could not write into file '.$tmp_file_path.' '.__FILE__.' '.__LINE__, 0); }

@ -1142,11 +1142,13 @@ function export_exercise($item_id) {
global $expdir, $_course, $_configuration, $_SESSION, $_SERVER, $language_interface, $langExerciseNotFound, $langQuestion, $langOk, $origin, $questionNum;
$exerciseId = $item_id;
require_once '../exercice/exercise.class.php';
require_once '../exercice/testcategory.class.php';
require_once '../exercice/exercise.class.php';
require_once '../exercice/question.class.php';
require_once '../exercice/answer.class.php';
require_once '../exercice/exercise.lib.php';
// Answer types
define('UNIQUE_ANSWER', 1);

Loading…
Cancel
Save