reports.cli.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'reports.lib.php';
  4. $longopts = array(
  5. 'course:',
  6. 'tool:',
  7. 'ci:',
  8. 'cn:',
  9. 'sci:',
  10. 'scn:',
  11. 'ssci:',
  12. 'sscn:',
  13. 'link:',
  14. 'addValue',
  15. 'addKey',
  16. 'help',
  17. 'clearAll',
  18. 'score:',
  19. 'progress:',
  20. 'time:',
  21. 'attempt:',
  22. 'session:',
  23. 'attempt:',
  24. 'uid:',
  25. 'key:',
  26. 'addDBKeys',
  27. 'build');
  28. $options = getopt("", $longopts);
  29. echo "\n\n";
  30. if (array_key_exists('help', $options))
  31. echo "help message\n";
  32. else if (array_key_exists('clearAll', $options)) {
  33. reports_clearAll();
  34. } else if (array_key_exists('build', $options)) {
  35. reports_build();
  36. } else if (array_key_exists('addDBKeys', $options)) {
  37. reports_addDBKeys();
  38. } else if (array_key_exists('addValue', $options)) {
  39. reports_addValue($options['key'], $options['session'], $options['uid'],
  40. $options['attempt'], $options['score'],
  41. $options['progress'], $options['time']);
  42. } else if (array_key_exists('addKey', $options)) {
  43. echo reports_addKey($options['course'], $options['tool'],
  44. $options['ci'], $options['cn'],
  45. $options['sci'], $options['scn'],
  46. $options['ssci'], $options['sscn'],
  47. $options['link']);
  48. echo "\n";
  49. } else
  50. echo "action not found\n";
  51. echo "\n";
  52. ?>