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

화면 13. Choice.maxButtonsPerRow [sink]

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

화면 번호13 / 21
문서 항목 설명 (원문)Takes a number from 1 to 10, and updates the layout to not allow more than that many buttons in a row. Note that built-in wrapping behavior could result in fewer buttons in a row. Only works with the "Button" layout of multiple choice or checkboxes, and only allows integer values between 1 and 10. Values less than 1 are ignored, and values greater than 10 are clamped to 10. Non-integers are first rounded.

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

화면 13 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1graphLeft그래프


narration(1): "The question \"How many buttons per row?\" and a number line from 1-9 with a movable point are shown."
▶ 첫 번째 내레이션(narration(1))은 "The question \"How many buttons per row?\" and a number line from 1-9 with a movable point are shown."(질문 "How many buttons per row?"(한 줄에 버튼이 몇 개인가?)와 1부터 9까지의 수직선, 움직이는 점 하나가 보인다.)로 한다.
narration은 화면 낭독기가 읽는 글자를 정하고, 괄호 안의 번호로 여러 개를 나눌 수 있다. 번호를 나누면 그래프의 기본 설명(1번)은 그대로 두고 다른 번호의 설명만 바꿀 수 있다. 글자 안의 \"는 따옴표 글자 하나이다.
narration(2): when this.number(`n_1`) = 1 " 1 button per row" otherwise "${this.number(`n_1`)} buttons per row." ▶ 두 번째 내레이션(narration(2))은 그래프 변수 `n_1`의 값(this.number(`n_1`))이 1과 같으면 " 1 button per row"(한 줄에 버튼 1개), 그 밖에는 "${this.number(`n_1`)} buttons per row."(한 줄에 버튼 ${n_1의 값}개.)로 한다.
this.number(…)는 이 그래프 안의 변수 값을 읽어 온다. 변수 이름은 백틱으로 감싸 적었으며, 백틱으로 감싼 글자는 latex 값이다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이고, when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
2레이블 없는 객관식 문제객관식 문제
# Set the maximum number of buttons in each row using the value or
# "n_1" (controlled by a movable point) in the graph.
▷ 그래프의 값 또는 "n_1"(움직이는 점이 조절한다)을 사용해 한 줄에 놓을 버튼의 최대 개수를 정한다.

maxButtonsPerRow: graphLeft.number(`n_1`)
▶ 한 줄의 최대 버튼 수(maxButtonsPerRow)는 그래프 graphLeft의 변수 `n_1`의 값(graphLeft.number(`n_1`))으로 한다.
graphLeft.number(…)는 그래프 graphLeft의 변수 값을 읽어 온다. 변수 이름은 백틱으로 감싸 적었으며, 백틱으로 감싼 글자는 latex 값이다. maxButtonsPerRow는 1부터 10까지의 수를 받아, 한 줄에 그 개수보다 많은 버튼이 놓이지 않게 배치를 바꾼다. 1보다 작은 값은 무시되고, 10보다 큰 값은 10으로 처리되며, 정수가 아니면 먼저 반올림한다. 선택지가 "Button" 배치일 때만 동작한다.