← 수업 제작 도구
홈 › Components › Graph and Graphing Calc › 화면 7

화면 7. Graph.labelLatex [source]

원본: Computation Layer 문서(Graph) · Try It (원본 화면)

화면 번호7 / 29
문서 항목 설명 (원문)Gets the inner latex content from a point label based on the name of the point.

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

화면 7 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1graph1그래프
# Defines a variable in this graph that corresponds with the choice
# selected in the multiple choice component.
▷ 객관식 구성요소에서 선택한 보기에 대응하는 변수를 이 그래프에 정의한다.
number("I"): when choice.isSelected(1) 1 when choice.isSelected(2) 2 when choice.isSelected(3) 3 otherwise 0 
▶ 그래프의 변수 "I"는 choice의 1번 보기가 선택되었다면(choice.isSelected(1)) 1, 2번이면 2, 3번이면 3, 어느 것도 선택되지 않았다면 0으로 한다.
isSelected(번호)는 객관식 구성요소 choice에서 그 번호의 보기가 선택되었는지를 참 또는 거짓으로 알려 주고, when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
2레이블 없는 메모메모
# This content sink will display the label that
# corresponds with the equation type that is 
# selected. labelLatex brings in the point label
# defined in graph1 for the points P_1, P_2 and P_3.
# Note: ${ } are used to interpolate the latex into the 
# content string and backticks are used to format as math.
▷ 이 content sink는 선택한 식의 종류에 맞는 라벨을 표시한다. labelLatex는 graph1의 점 P_1, P_2, P_3에 정의된 라벨을 가져온다. 참고로 ${ }는 LaTeX를 content 글자 안에 끼워 넣을 때 쓰고, 백틱은 수식 형식으로 표시하기 위해 쓴다.

content: 
  when choice.isSelected(1) "Linear Equation: `${graph1.labelLatex("P_1")}`"
  when choice.isSelected(2) "Quadratic Equation: `${graph1.labelLatex("P_2")}`"
  when choice.isSelected(3) "Exponential Equation: `${graph1.labelLatex("P_3")}`"
  otherwise "Select a type of equation."
▶ 메모의 내용(content)은 choice의 1번 보기가 선택되면 "Linear Equation: "(일차방정식: ) 뒤에 그래프 graph1의 점 P_1의 라벨(graph1.labelLatex("P_1"))을, 2번이면 "Quadratic Equation: "(이차방정식: ) 뒤에 P_2의 라벨을, 3번이면 "Exponential Equation: "(지수방정식: ) 뒤에 P_3의 라벨을 붙인 글자로, 어느 것도 선택되지 않았다면 "Select a type of equation."(방정식의 종류를 선택하시오.)으로 한다.
labelLatex("P_1")은 점 P_1의 라벨에 들어 있는 LaTeX 글자를 가져온다. ${ }는 글자 안에 값을 끼워 넣는 표기이고, 글자 안의 백틱(`)은 그 글자를 수식 모양으로 표시하게 한다.