Lesson 4.1: Developers, written test
This test closes the Developers course. It checks the knowledge a developer needs before writing code for a site: how an extension is switched on and found, how a module view is protected, how a template is chosen, how to work with Git clones, and how a release is made without breaking anyone's install.
Note
This is the trainer's own assessment, not an official certification. Commands are those of the guides; check them on the release you teach.
At a glance
| Course | Assessments and practical exercises |
| Module | Module 4: Assessing the technical courses |
| Duration | 45 minutes (5 briefing, 30 test, 10 going through the answers) |
| Level | Intermediate to advanced |
| Audience | Learners at the end of the Developers course |
| Prerequisites | The Developers course; Lesson 1.2 for the trainer |
Learning objectives
Learners who pass this test have shown that they can:
- explain how an extension is activated, ordered and given classes, settings and templates;
- protect a module view with a function and a policy;
- explain the template lookup order and an override rule;
- explain why Git clones help development and how to set Composer to prefer them;
- describe a safe release of an extension.
Trainer's notes
How to run it
- Hand out the questions without the key; 30 minutes.
- Go through the answers with Extensions and Templates and design on the projector.
Common questions
The REST question is out of scope for us. Drop question 12 and lower the pass mark by one.
Pitfalls
- Learners answering from other frameworks. "Routes in YAML" is a wrong answer here; this kernel uses
module.php. Accept only what the guides say.
The test
- Which setting switches an extension on for the whole installation, and which for one siteaccess?
- Two active extensions override the same template. Which one wins?
- You added a class in your extension's
classes/folder and get "Class not found". Which command fixes it? - Which two files describe an extension for Setup > About and Setup > Extensions, and what must agree between them?
- What tells the kernel to look for modules in your extension?
- Your new view has no
'functions'entry. Who can open it? - In which order does the template system look for
node/view/full.tpl? - In an override rule, what do
Source,MatchFileandMatch[...]mean? - Which command checks a template's syntax without opening a browser?
- Why should every value a user typed be printed with
|wash? - Name two things a Git clone of a package lets you do that a release archive does not.
- Which REST API version answers writes (create, update, delete)?
- Before tagging a release of your extension, how do you choose the number?
- A tag you pushed points at the wrong commit. What do you do?
Answers
[ExtensionSettings] ActiveExtensions[]insite.inifor the installation;ActiveAccessExtensions[]for one siteaccess (Extensions).- The one loaded earlier; with
ExtensionOrdering=enabledthe dependencies inextension.xmldecide the order first (Extensions). php bin/php/ezpgenerateautoloads.php -e, then clear the caches and reload PHP-FPM or Velocity (Extensions).ezinfo.phpandextension.xml; the version must be the same in both (Extensions).ExtensionRepositories[]=<extension>in the extension'ssettings/module.ini.append.php(Extensions).- Anyone who can reach the site: a view without a function has no access control (Extensions).
- Matching override templates, the site design's
templates/, the additional designs, thenstandard(Templates and design). Source: the template replaced;MatchFile: your file relative tooverride/templates/;Match[...]: the conditions, all of which must hold (Templates and design).php bin/php/eztemplatecheck.phpwith the siteaccess and the file or directory (Templates and design).washescapes HTML, so typed text cannot inject markup or scripts (Templates and design).- Two of: see every change with
git diff, find why a line is there withgit log/git blame, find a breaking change withgit bisect, use a fix before release, keep own changes on a branch, send a pull request (Develop with Git). - v2 only; reads answer at v1 and v2 (REST API v1 and v2).
- From what is already published:
git fetch --tags, then list tags sorted by version (--sort=version:refname), never by name (Extensions). - Leave it; publish the next version with the fix and say in its notes what was wrong. Never move or delete a pushed tag (Extensions).
Scoring
- One point per question; questions 1, 4 and 8 need every part for the point (half a point otherwise).
- Pass: 10 of 14 points or more, with questions 6 and 14 correct: one is security, the other cannot be undone.
Further reading
- Extensions: activation, building, releasing.
- Templates and design: lookup, overrides, the language.
- Develop with Git and REST API v1 and v2.
- Extension development: the book behind the course.
Related pages
- Lesson 4.2: Developers, practical task
- Module 4: Assessing the technical courses
- Assessments and practical exercises: course overview
- Trainers: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.