aiken_classes.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @author Claro Team <cvs@claroline.net>
  5. * @author Yannick Warnier <yannick.warnier@beeznest.com> - updated ImsAnswerHotspot to match QTI norms
  6. * @author César Perales <cesar.perales@gmail.com> Updated function names and import files for Aiken format support
  7. * @package chamilo.exercise
  8. */
  9. /**
  10. * Code
  11. */
  12. if ( count( get_included_files() ) == 1 ) die( '---' );
  13. if (!function_exists('mime_content_type')) {
  14. require_once api_get_path(LIBRARY_PATH).'document.lib.php';
  15. function mime_content_type($filename) {
  16. return DocumentManager::file_get_mime_type((string)$filename);
  17. }
  18. }
  19. require_once(api_get_path(SYS_CODE_PATH).'/exercice/answer.class.php');
  20. require_once(api_get_path(SYS_CODE_PATH).'/exercice/exercise.class.php');
  21. require_once(api_get_path(SYS_CODE_PATH).'/exercice/question.class.php');
  22. require_once(api_get_path(SYS_CODE_PATH).'/exercice/unique_answer.class.php');
  23. /**
  24. * Aiken2Question transformation class
  25. */
  26. class Aiken2Question extends Question
  27. {
  28. /**
  29. * Include the correct answer class and create answer
  30. */
  31. function setAnswer()
  32. {
  33. switch($this->type)
  34. {
  35. case MCUA :
  36. $answer = new AikenAnswerMultipleChoice($this->id);
  37. return $answer;
  38. default :
  39. $answer = null;
  40. break;
  41. }
  42. return $answer;
  43. }
  44. function createAnswersForm($form)
  45. {
  46. return true;
  47. }
  48. function processAnswersCreation($form)
  49. {
  50. return true;
  51. }
  52. }
  53. /**
  54. * Class
  55. * @package chamilo.exercise
  56. */
  57. class AikenAnswerMultipleChoice extends Answer
  58. {
  59. }