Asset Media
Asset media는 /upload/[surveyId] 파일을 HTML Mode, GUI Mode, Template Expression, Survey Link에 연결하지만 media gate 자체를 response variable로 만들지는 않습니다.
Uploaded asset 경계
Media helper와 media question은 의도적으로 survey asset 전용입니다. Upload entrypoint에서 public image, video, GLB 파일을 추가한 뒤 HTML DSL에서 상대 asset path를 참조합니다.
<question type="video" name="INTRO_VIDEO" required source="media/intro.mp4" require-full-watch="true">
<description>Watch the introduction.</description>
</question>
<question type="glb" name="PRODUCT_MODEL" required source="models/product.glb">
<description>Review the product model.</description>
</question>
규칙:
source는 같은 survey에 업로드된 public survey asset 또는 허용된/assets/[surveyId]/...route로 해석되어야 합니다.source에는 Template Expression을 사용할 수 있지만, 동적source="{{ ... }}"는 GUI source selector를EXP로 잠그므로 HTML Mode에서 수정합니다.video와glb는 응답값이 없는 media gate question type입니다. 일반 response value나 CSV/XLSX export column을 만들지 않습니다.video require-full-watch="true"는 custom video player를 사용하고, 영상이 끝날 때까지 page navigation을 비활성화합니다. Survey Link는 “watch the full video to continue” 같은 visible helper copy를 추가하지 않습니다.- GLB 문항은
model-viewer로 렌더링되며 runtime은 필요할 때만@google/model-viewer를 로드합니다.
$asset Template Expression helper
Media가 gate가 아니라 content인 경우 rich text 또는 Template Expression을 지원하는 text에서 $asset을 사용합니다.
<question type="info" name="MEDIA_CARD">
<description>
{{ $asset.img("images/hero.png", { width: "100%", borderRadius: "16px" }) }}
{{ $asset.video("media/intro.mp4", { width: "100%", controls: true }) }}
{{ $asset.glb("models/product.glb", { height: "360px", autoRotate: true }) }}
</description>
</question>
Helper method:
| Helper | 출력 | 메모 |
|---|---|---|
$asset.img(path, config) | Sanitized <img> | Image 파일 전용입니다. Lazy loading과 안전한 sizing config를 지원합니다. |
$asset.video(path, config) | Sanitized <video> | Video 파일 전용입니다. controls, muted, loop, playsInline을 지원합니다. |
$asset.glb(path, config) | Sanitized <model-viewer> | GLB 파일 전용입니다. cameraControls, autoRotate, shadowIntensity, exposure를 지원합니다. |
공통 config는 안전한 sizing/presentation field인 width, height, maxWidth, maxHeight, borderRadius, objectFit을 허용합니다.
Response와 export 정책
Media helper는 sanitized HTML fragment를 만들고, media gate question은 gate 상태만 만듭니다. 두 surface 모두 respondent answer column을 쓰지 않습니다. 시청/확인 여부를 저장해야 한다면 video/glb field에 의존하지 말고 media gate 뒤에 별도 명시 문항이나 hidden run-code answer를 추가하세요.