aiken_classes.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. if ( count( get_included_files() ) == 1 ) die( '---' );
  10. if (!function_exists('mime_content_type')) {
  11. /**
  12. * @param string $filename
  13. * @return string
  14. */
  15. function mime_content_type($filename) {
  16. return DocumentManager::file_get_mime_type((string)$filename);
  17. }
  18. }
  19. /**
  20. * Aiken2Question transformation class
  21. */
  22. class Aiken2Question extends Question
  23. {
  24. /**
  25. * Include the correct answer class and create answer
  26. */
  27. function setAnswer()
  28. {
  29. switch($this->type)
  30. {
  31. case MCUA :
  32. $answer = new AikenAnswerMultipleChoice($this->id);
  33. return $answer;
  34. default :
  35. $answer = null;
  36. break;
  37. }
  38. return $answer;
  39. }
  40. function createAnswersForm($form)
  41. {
  42. return true;
  43. }
  44. function processAnswersCreation($form)
  45. {
  46. return true;
  47. }
  48. }
  49. /**
  50. * Class
  51. * @package chamilo.exercise
  52. */
  53. class AikenAnswerMultipleChoice extends Answer
  54. {
  55. }