feat: image and video blocks - #3638
Open
global-prog wants to merge 1 commit into
Open
Conversation
Adds two display-only blocks so a form can show a picture or point at a video between its questions, rather than only text. They are modelled as ordinary question types that happen to carry no answer, which keeps them in the existing ordering and drag-and-drop with no new concepts. A shared ANSWER_TYPES_DISPLAY_ONLY list marks them so they are skipped when validating a submission and filtered out of exports - without that, each block would add an empty column to every CSV. Video is deliberately NOT embedded in an iframe. Embedding makes every respondent's browser contact the video host on page load, disclosing their IP address and usually setting cookies, which would quietly undermine a form marked as anonymous. It renders as a link the respondent chooses to follow. Images do render inline, since that is the point of an image block, but with referrerpolicy="no-referrer" so the form's address is not passed on, and the editor warns when the address is not on this instance. No schema change: the address and description live in the existing extraSettings. FormsQuestionType is left alone, matching how linearscale, ranking and color are already handled, so openapi.json is unaffected. Signed-off-by: global-prog <raqeeb@uosamarra.edu.iq>
global-prog
force-pushed
the
contrib/media-blocks
branch
from
September 9, 2026 01:19
b719715 to
e52688b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two display-only blocks, so a form can show a picture or point at a video between its questions rather than only text.
They are modelled as ordinary question types that happen to carry no answer, which keeps them inside the existing ordering and drag-and-drop with no new concepts to learn. A shared
ANSWER_TYPES_DISPLAY_ONLYlist marks them, so they are skipped when validating a submission and filtered out of exports — without that, each block would add an empty column to every CSV.One deliberate choice: video is a link, not an embed
Embedding would make every respondent's browser contact the video host on page load, disclosing their IP address and usually setting cookies. On a form marked as anonymous that would quietly undermine the promise being made to respondents, so the block renders as a link they choose to follow.
Images do render inline, since that is the point of an image block, but with
referrerpolicy="no-referrer"so the form's own address is not passed on. The editor also warns when the address is not on this instance:I am happy to add an opt-in embed for video if you would rather have it, but I did not think it should be the default.
Scope
extraSettingsFormsQuestionTypeis left alone, matching howlinearscale,rankingandcolorare already handled, soopenapi.jsonis unaffectedTesting
npm run lint,npm run stylelintandphp -lcleanmainwith no errors