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

화면 1. Graph.number [source]

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

화면 번호1 / 29
문서 항목 설명 (원문)Gets the numerical value of a variable in the graph.

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

화면 1 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1tangentGraph1그래프
# Sets the value of "a" in the graphing calculator to be
# the numeric value of "xValue" provided that it has been
# submitted. Otherwise we choose an x value that is far outside
# of the graph bounds.
▷ xValue의 값이 제출되었다면 그래핑 계산기의 변수 "a"의 값을 그 값으로 정한다. 제출되지 않았을 때는 경계를 한참 벗어난 값으로 정한다.

number("a"):
  when xValue.submitted xValue.numericValue
  otherwise 10000
▶ 그래프의 변수 "a"는 xValue(수식 답변)에 답이 제출되었다면(xValue.submitted) 그 값의 숫자값(xValue.numericValue)으로, 제출되지 않았다면 그래프 경계(bounds)를 한참 벗어난 10000으로 한다.
number("a")는 이 그래프 안의 변수 "a"의 값을 정하고, submitted는 답이 제출되었는지를 참 또는 거짓으로, numericValue는 입력한 식을 계산한 숫자값을 알려 준다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
2xValue수식 답변
# Sets the correct sink as true when the "c_orrect" variable
# in the tangentGraph calculator component is equal to 1.
▷ tangentGraph 그래핑 계산기 구성요소의 변수 "c_orrect"가 1과 같으면 correct sink를 true로 정한다.
correct: tangentGraph.number("c_{orrect}") = 1
▶ 정답 조건(correct)은 그래프 tangentGraph의 변수 "c_{orrect}"의 값이 1이면 참(정답), 아니면 거짓으로 한다(tangentGraph.number("c_{orrect}") = 1).
tangentGraph.number("c_{orrect}")는 그래프 안의 변수 값을 읽어 오고, =는 같은지를 비교한다. correct는 참이면 교사 대시보드 요약에 회색 체크를 표시한다.