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

화면 6. Choice.choiceContent [source]

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

화면 번호6 / 21
문서 항목 설명 (원문)Gets the string content for choice with the provided index.

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

화면 6 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 그래프그래프
# Sets the point label used to label a bar in a bar
# graph based on the choice selected. If nothing is
# selected the label will show "?".
▷ 선택한 보기에 따라 막대그래프의 막대에 붙일 점 라벨을 정한다. 아무것도 선택하지 않았다면 라벨은 "?"로 표시된다.
pointLabel("P_2"):
  when choice1.isSelected(1) choice1.choiceContent(1)
  when choice1.isSelected(2) choice1.choiceContent(2)
  when choice1.isSelected(3) choice1.choiceContent(3)
  otherwise "?"
▶ 점 P_2의 라벨(pointLabel)은 choice1의 1번 보기가 선택되었다면(choice1.isSelected(1)) 1번 보기의 글자(choice1.choiceContent(1)), 2번이면 2번 보기의 글자, 3번이면 3번 보기의 글자, 어느 것도 선택되지 않았다면 "?"로 한다.
pointLabel("P_2")는 이름이 P_2인 점의 라벨 글자를 정하고, 라벨은 정한 글자와 똑같이 표시된다. choiceContent(번호)는 그 번호의 보기에 적힌 글자를 가져오고, isSelected(번호)는 객관식 구성요소에서 그 번호의 보기가 선택되었는지를 참 또는 거짓으로 알려 준다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
2choice1객관식 문제
explainPrompt: "What situation does your graph represent?"
▶ 설명 안내 문구(explainPrompt)는 "What situation does your graph represent?"(당신의 그래프는 어떤 상황을 나타내는가?)로 한다.
explainPrompt는 설명(explain)이 있는 객관식 구성요소에서 일반 문구 "Explain your thinking" 자리에 쓸 글자를 정한다.