← 수업 제작 도구
홈 › Components › Math Response (수식 답변) › 화면 2

화면 2. Math Input.numericValue [source]

원본: Computation Layer 문서(Math Response (수식 답변)) · Try It (원본 화면)

화면 번호2 / 28
문서 항목 설명 (원문)numericValue Gets the evaluated value of an expression input. For example, "2+2" will return the number 4.

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

화면 2 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1cubicGraph그래프
# This imports the numeric value of the "inspectInput" expression input and
# assigns it to the variable "a" in the graph component.
▷ "inspectInput"이라는 수식 답변의 숫자 값을 가져와 그래프 구성요소의 변수 "a"에 정한다.

number("a"): inspectInput.numericValue
▶ 그래프의 변수 a는 수식 답변 inspectInput의 계산한 값(inspectInput.numericValue)으로 한다.
number("이름")은 그래핑 계산기 안의 변수 값을 정한다. numericValue는 입력한 식을 계산한 값을 가져온다. 예를 들어 "2+2"는 숫자 4를 돌려준다. a에는 학생이 입력한 식을 계산한 값이 들어간다.
2레이블 없는 메모메모
# This is a common design pattern in Desmos activiites where
# we'll present the prompt in the content sink and then
# attach a feedback variable which checks for different conditions
# (in this case, whether or not the x-value will result in a y-value
# that's off screen) and displays appropriate feedback.
▷ 이것은 Desmos 활동에서 흔히 쓰는 설계 방식이다. 메모의 content sink에 문제 글을 두고, 여러 조건(여기서는 x 값이 화면 밖의 y 값을 만드는지)을 검사해 알맞은 피드백을 보여 주는 피드백 변수를 붙인다.

feedback =

	when cubicGraph.number("a") < -9.3 or cubicGraph.number("a") > 10 "\n\nYour point is off the screen."
    otherwise ""
▶ 변수 feedback은 cubicGraph.number("a")가 -9.3보다 작거나 10보다 크면 "\n\nYour point is off the screen."(점이 화면 밖에 있다.), 그렇지 않으면 빈 글자로 한다.
cubicGraph.number("a")는 그래프 cubicGraph의 변수 a의 숫자 값을 알려 준다. 글자 안의 \n은 줄바꿈 하나이고 \n\n은 줄바꿈 두 번(빈 줄)이다. \는 바로 뒤 글자의 뜻을 바꾸는 표시이다. or는 둘 중 하나라도 참이면 참이고, when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
content: "Enter the value for x you want to inspect.${feedback}" ▶ 메모의 내용(content)은 "Enter the value for x you want to inspect.${feedback}"(살펴보고 싶은 x의 값을 입력하시오.) 뒤에 feedback의 값이 이어지는 글로 한다.
${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다. content는 메모에 직접 적은 글을 덮어쓴다. 점이 화면 밖에 있으면 안내 문구 아래에 경고 글이 나타난다.