← 수업 제작 도구
홈 › Components › Free Response (자유 답변) › 화면 3

화면 3. Input.submitted [source]

원본: Computation Layer 문서(Free Response (자유 답변)) · Try It (원본 화면)

화면 번호3 / 9
문서 항목 설명 (원문)submitted Gets a Boolean value indicating whether or not the input has been submitted.

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

화면 3 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 메모메모
# This code imports the value a student typed into
# an input called “nameInput3” and assigns it to a
# variable called “name”.
▷ 이 코드는 학생이 "nameInput3"이라는 입력칸에 입력한 값을 가져와 "name"이라는 변수에 정한다.

name = nameInput3.content
▶ 변수 name은 nameInput3에 학생이 입력한 값(nameInput3.content)으로 한다.

# This code displays content in a note. If the input has been
# submitted, we display a greeting. If it hasn’t been
# submitted, we display a request.
▷ 이 코드는 메모에 내용을 표시한다. 입력칸이 제출되었으면 인사말을 보여 주고, 제출되지 않았으면 요청 문구를 보여 준다.

content:

     when nameInput3.submitted "Good to meet you, ${name}."
     otherwise "Please type your name below."
▶ 메모의 내용(content)은 nameInput3이 제출되었으면 "Good to meet you, ${name}."(만나서 반갑다, 이름.)로, 그렇지 않으면 "Please type your name below."(아래에 이름을 입력하시오.)로 한다.
submitted는 입력이 제출되었는지를 참 또는 거짓으로 알려 주고, when은 조건을 차례로 확인해 처음 맞는 값을 쓴다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다. content는 메모에 직접 적은 글을 덮어쓴다.