reports.cli.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. }
  52. echo "\n";
  53. ?>