NEW
Font size
WorksheetsQuiz sur MVC, PHP et GIT .
Total questions: 30
Worksheet time: 15mins
What is the main responsibility of the Model in MVC?
Manage the display of data to the user
Contain business logic and data access
Coordinate interactions between View and Model
Handle HTTP requests and routing
Which of these elements represents a common MVC anti-pattern?
Use of a View Helper
Template Inheritance
Fat Controller
Repository Pattern
Which pattern is typically used as a single entry point in MVC web?
Singleton Pattern
Factory Pattern
Front Controller Pattern
Observer Pattern
True or False: In a web MVC architecture, the View can directly query the database.
True
False
What is the main difference between traditional MVC (Desktop) and MVC Web?
MVC Web does not have a Model
MVC Web uses the Front Controller pattern
Traditional MVC does not have a Controller
There is no difference
What is the main role of a 'View Helper'?
Manage the database connection
Execute complex queries
Assist the View with presentation tasks
Validate user data
Which of these elements is NOT part of the typical lifecycle of an MVC request?
Routing to the appropriate controller
Direct querying of the database by the View
Processing by the Model
Rendering by the View
Which architecture is often considered an evolution of MVC?
MVVM (Model-View-ViewModel)
MVP (Model-View-Presenter)
ADR (Action-Domain-Responder)
All of these answers
Which PSR standardizes the autoloading of classes in PHP?
PSR-0
PSR-1
PSR-2
PSR-4
How are data typically passed from a controller to a view in PHP MVC?
Global variables
PHP sessions
Associative array passed to the template system
Shared database
What is the main advantage of the Repository Pattern in an MVC architecture?
Improve database performance
Separate data access logic from business logic
Reduce the number of files
Simplify routing
True or False: Dependency injection violates the separation of concerns principle.
True
False
Which design pattern is often used to create complex Vue objects?
Singleton Pattern
Factory Pattern
Observer Pattern
Decorator Pattern
Which method is recommended to secure routes against injections?
Disable JavaScript
Validation and sanitization of parameters
Use only static routes
Ignore 404 errors
What is the main role of a Data Transfer Object (DTO)?
Manage database transactions
Transport data between layers without business logic
Create user interfaces
Validate user input
Which of these elements is a good practice for error management in MVC?
Display SQL errors directly to the user
Use exceptions and a centralized error handler
Hide all errors with @
Log only critical errors
Which SOLID principle is violated when a controller handles authentication, validation, and business logic at the same time?
Open/Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Single Responsibility Principle
How is the Dependency Inversion Principle applied in an MVC controller?
By inheriting from multiple classes
By depending on abstractions rather than concrete implementations
By avoiding any dependency
By using singletons
True or False: The Interface Segregation Principle encourages the creation of large and generic interfaces.
True
False
Which of these scenarios illustrates a violation of the Liskov Substitution Principle?
A Repository that extends a base class but does not support all its methods
A controller that uses dependency injection
A View that inherits from a base template
A Model that implements an interface
How does the Interface Segregation Principle improve testability?
By making classes more complex
By making it easier to mock specific dependencies
By reducing the number of interfaces
By forcing the use of inheritance
What advantage does respecting the SOLID principles bring to an MVC project?
Code more difficult to maintain
Decrease in testability
Increase in coupling between components
Better scalability and maintainability
Which Git workflow is recommended for collaborative development on features?
Feature Branch Workflow
Trunk-Based Development only
No branching
Only one developer at a time
Which type of commit best describes "Ajout de la validation dans le contrôleur UserController"?
feat: add validation to UserController
fix: stuff
chore: update
test: changes
True or False: Sensitive configuration files (such as .env) should be committed to Git.
True
False
Which element should be included in a Pull Request template for an MVC project?
List of architectural changes
Photos of the developer
Personal criticisms
No description
What is the best practice for database migrations in a collaborative workflow?
Each developer creates their own tables
Migrations are versioned and applied in order
No migration system
Direct modification of the production database
How to manage PHP dependencies in a versioned project?
Commit the vendor/ folder
Use composer.json and .lock without committing vendor/
Do not use a dependency manager
Manually copy the files
What is the advantage of using Conventional Commits?
Automatic generation of CHANGELOG
Make messages more vague
Avoid responsibility
Nothing, it's just a trend
Which approach is recommended for code review in an MVC project?
Review only the controller
Ignore the tests
Checklist covering all layers (Model, View, Controller)
Approve without looking
