← 수업 제작 도구
홈 › Components › Action Button (행동 버튼) › 화면 1

화면 1. Action Button.timeSincePress [source]

원본: Computation Layer 문서(Action Button (행동 버튼)) · Try It (원본 화면)

화면 번호1 / 12
문서 항목 설명 (원문)timeSincePressmaxTime: number Gets the seconds (plus milliseconds) since the "Submit" button was pressed. It resets to zero if the "reset" link is pressed, or if a component on the same page is focused or edited. By default, it runs to 10 seconds and then stops. Increase that time by passing a parameter, as in timeSincePress(20).

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

화면 1 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 메모메모
# This code imports the time since a student pressed an
# action button called "submitMe" and assigns it to a variable
# called "myTime".
▷ 이 코드는 학생이 "submitMe"라는 행동 버튼을 누른 뒤 지난 시간을 가져와 "myTime"이라는 변수에 정한다.

myTime = submitMe.timeSincePress
▶ 변수 myTime은 행동 버튼 submitMe를 누른 뒤 지난 시간(submitMe.timeSincePress)으로 한다.
submitMe.timeSincePress는 행동 버튼 submitMe를 누른 뒤 지난 시간을 알려 준다. 재설정 링크를 누르거나 같은 화면의 구성요소를 선택하거나 편집하면 0으로 돌아가고, 기본으로 10초까지 센 뒤 멈추며, timeSincePress(20)처럼 괄호 안에 숫자를 넣으면 그 숫자가 세는 최대 시간(초)이 된다.
# This code injects that time into a sentence in the note. ▷ 이 코드는 그 시간을 메모의 문장 안에 끼워 넣는다. content: "It has been ${myTime} seconds since you pressed \"Submit\"." ▶ 메모의 내용(content)은 "It has been ${myTime} seconds since you pressed \"Submit\"."(Submit을 누른 지 ${myTime}초가 되었다.)로 한다.
글자 안의 \"는 따옴표 글자 하나이다. \는 바로 뒤 글자의 뜻을 바꾸는 표시이므로 \"는 글자의 끝이 아니라 "Submit" 둘레의 따옴표 글자이다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다. content는 메모에 직접 적은 글을 덮어쓴다.