← 수업 제작 도구
홈 › Components › Card Sort (카드 정렬) › 화면 3

화면 3. Card Sort.matchesKey [source]

원본: Computation Layer 문서(Card Sort (카드 정렬)) · Try It (원본 화면)

화면 번호3 / 3
문서 항목 설명 (원문)matchesKey Returns whether response matches the answer key. If no answer key is provided, returns false.

1. 화면 캡처 (빨간 번호 = 아래 표의 번호)

화면 3 캡처

화면에 적힌 영어 문구(원문):

2. CL이 입력된 곳

코드 안의 회색 줄은 원문 영어 주석이고, 파란 줄은 그 영어 주석의 번역이며, 연분홍 줄은 코드가 하는 일의 설명이다.

번호이름종류CL 코드 원문, 번역, 설명
1master CL
(화면 전체)
SCREEN
# This code identifies whether a card sort called “sort” 
# matches its answer key and assigns true or false to
# variable called “match”.
▷ "sort"라는 카드 정렬이 정답 키와 일치하는지를 알아내, 참 또는 거짓을 "match"라는 변수에 정한다.

match = sort.matchesKey
▶ 변수 match는 응답이 정답 키와 일치하는지(sort.matchesKey)로 한다.
정답 키가 없으면 거짓이다.
# This code creates a feedback message based # on that boolean value by creating a variable # "complete". ▷ 그 참/거짓 값에 따라 피드백 메시지를 만든다. 이를 위해 변수 "complete"를 만든다. complete = when match "Yes" otherwise "No" ▶ 변수 complete는 match가 참이면 "Yes"로, 그렇지 않으면 "No"로 한다.
when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
# This code injects the "complete" variable into # the subtitle. ▷ "complete" 변수를 부제목에 끼워 넣는다. subtitle: "Matches Key? ${complete}" ▶ 화면 제목 아래에 표시할 부제목(subtitle)은 "Matches Key? ${complete}"(정답 키와 일치하는가? complete의 값)로 한다.
${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다.