You are here

quiz.routing.yml in Quiz 8.6

Same filename and directory in other branches
  1. 8.4 quiz.routing.yml
  2. 8.5 quiz.routing.yml
  3. 6.x quiz.routing.yml

File

quiz.routing.yml
View source
  1. # Take quiz
  2. entity.quiz.take:
  3. path: 'quiz/{quiz}/take'
  4. defaults:
  5. _controller: '\Drupal\quiz\Controller\QuizController::take'
  6. _title: 'Quiz router'
  7. requirements:
  8. _entity_access: 'quiz.view'
  9. options:
  10. parameters:
  11. quiz:
  12. type: 'entity:quiz'
  13. # Take question
  14. quiz.question.take:
  15. path: 'quiz/{quiz}/take/{question_number}'
  16. defaults:
  17. _controller: '\Drupal\quiz\Controller\QuizQuestionController::take'
  18. _title: 'Quiz question router'
  19. requirements:
  20. _custom_access: '\Drupal\quiz\Controller\QuizQuestionController::checkAccess'
  21. options:
  22. parameters:
  23. quiz:
  24. type: 'entity:quiz'
  25. question_number:
  26. # This is the question number.
  27. type: 'question_number'
  28. # Question feedback
  29. quiz.question.feedback:
  30. path: 'quiz/{quiz}/take/{question_number}/feedback'
  31. defaults:
  32. _controller: '\Drupal\quiz\Controller\QuizQuestionController::feedback'
  33. _title: 'Quiz feedback router'
  34. requirements:
  35. _custom_access: '\Drupal\quiz\Controller\QuizQuestionController::checkFeedbackAccess'
  36. options:
  37. parameters:
  38. quiz:
  39. type: 'entity:quiz'
  40. question_number:
  41. # This is the question number.
  42. type: 'question_number'
  43. # Question management tab
  44. quiz.questions:
  45. path: 'quiz/{quiz}/questions'
  46. defaults:
  47. _controller: '\Drupal\quiz\Controller\QuizController::manageQuestions'
  48. _title: 'Manage questions'
  49. requirements:
  50. _entity_access: 'quiz.update'
  51. options:
  52. _admin_route: true
  53. parameters:
  54. quiz:
  55. type: 'entity:quiz'
  56. # Admin page route
  57. quiz.admin:
  58. path: '/admin/quiz'
  59. defaults:
  60. _controller: '\Drupal\quiz\Controller\QuizAdminController::overview'
  61. _title: 'Quiz'
  62. requirements:
  63. _permission: 'administer quiz'
  64. # Admin block routes
  65. quiz.admin.config:
  66. path: '/admin/quiz/config'
  67. defaults:
  68. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  69. _title: 'Configuration'
  70. requirements:
  71. _permission: 'administer quiz'
  72. quiz.admin.quizzes:
  73. path: '/admin/quiz/quizzes'
  74. defaults:
  75. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  76. _title: 'Quizzes'
  77. requirements:
  78. _permission: 'administer quiz'
  79. quiz.admin.questions:
  80. path: '/admin/quiz/questions'
  81. defaults:
  82. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  83. _title: 'Questions'
  84. requirements:
  85. _permission: 'administer quiz'
  86. quiz.admin.reports:
  87. path: '/admin/quiz/reports'
  88. defaults:
  89. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  90. _title: 'Reports'
  91. requirements:
  92. _permission: 'administer quiz'
  93. quiz.admin.structure:
  94. path: '/admin/quiz/config/structure'
  95. defaults:
  96. _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
  97. _title: 'Questions'
  98. requirements:
  99. _permission: 'administer quiz'
  100. # Quiz settings
  101. quiz.admin.settings:
  102. path: '/admin/quiz/config/quiz'
  103. defaults:
  104. _form: '\Drupal\quiz\Form\QuizAdminForm'
  105. _title: 'Quiz'
  106. requirements:
  107. _permission: 'administer quiz'
  108. # Quiz settings
  109. quiz.admin.settings.defaults:
  110. path: '/admin/quiz/config/defaults'
  111. defaults:
  112. _form: '\Drupal\quiz\Form\QuizDefaultsForm'
  113. _title: 'Quiz'
  114. requirements:
  115. _permission: 'administer quiz'
  116. # Quiz feedback type conditions (Rules UI)
  117. entity.quiz_feedback_type.conditions:
  118. path: 'admin/quiz/feedback/type/{quiz_feedback_type}/conditions'
  119. defaults:
  120. _form: '\Drupal\quiz\Form\QuizFeedbackConditionsForm'
  121. _title: 'Feedback conditions'
  122. requirements:
  123. _permission: 'administer quiz'
  124. options:
  125. _rules_ui: quiz_feedback.rules_ui_conditions
  126. parameters:
  127. quiz_feedback_type:
  128. type: 'entity:quiz_feedback_type'