← 수업 제작 도구
홈 › Components › Multiple Choice and Checkboxes › 화면 21

화면 21. Choice.matchesKey [Source]

원본: Computation Layer 문서(Multiple Choice and Checkboxes) · Try It (원본 화면)

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

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

화면 21 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1master CL
(화면 전체)
SCREEN
subtitle: "Select all of the prime numbers."
▶ 화면 제목 아래에 표시할 부제목(subtitle)은 "Select all of the prime numbers."(소수를 모두 고르시오.)로 한다.
subtitle은 화면 제목 아래 가운데에 부제목을 붙인다.
2레이블 없는 메모메모
# Answers the question "Matches Key?" in the note with a "✅"
# when the seleected options match the answer key. 
▷ 메모의 "Matches Key?"(정답 키와 일치하는가?)라는 질문에, 선택한 보기가 정답 키와 일치하면 "✅"로 답한다.
match = 
  when choice.matchesKey "✅"
  otherwise ""
▶ 변수 match는 choice.matchesKey가 참이면 "✅", 그렇지 않으면 빈 글자로 한다.
matchesKey는 응답이 정답 키와 일치하는지를 알려 주고, 정답 키가 없으면 거짓이다. 메모의 글 "Matches Key?" 뒤에 변수 match가 끼워져 있다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.