defaults.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package file
  2. import "path/filepath"
  3. var (
  4. DefaultBaseDir = "data"
  5. DefaultQuizzesSubdir = "quizzes"
  6. DefaultCollectionsSubdir = "collections"
  7. DefaultParticipantsSubdir = "participants"
  8. DefaultGroupsSubdir = "groups"
  9. DefaultExamsSubdir = "exams"
  10. DefaultResponsesSubdir = "responses"
  11. DefaultSessionSubdir = "sessions"
  12. Dirs = []string{
  13. GetDefaultQuizzesDir(),
  14. GetDefaultParticipantsDir(),
  15. GetDefaultExamsDir(),
  16. GetDefaultSessionDir(),
  17. }
  18. )
  19. func GetDefaultQuizzesDir() string {
  20. return filepath.Join(DefaultBaseDir, DefaultQuizzesSubdir)
  21. }
  22. func GetDefaultCollectionsDir() string {
  23. return filepath.Join(DefaultBaseDir, DefaultCollectionsSubdir)
  24. }
  25. func GetDefaultParticipantsDir() string {
  26. return filepath.Join(DefaultBaseDir, DefaultParticipantsSubdir)
  27. }
  28. func GetDefaultGroupsDir() string {
  29. return filepath.Join(DefaultBaseDir, DefaultGroupsSubdir)
  30. }
  31. func GetDefaultExamsDir() string {
  32. return filepath.Join(DefaultBaseDir, DefaultExamsSubdir)
  33. }
  34. func GetDefaultSessionDir() string {
  35. return filepath.Join(DefaultBaseDir, DefaultSessionSubdir)
  36. }
  37. func GetDefaultResponsesDir() string {
  38. return filepath.Join(DefaultBaseDir, DefaultResponsesSubdir)
  39. }