← 수업 제작 도구
홈 › Components › Ordered List (정렬 리스트) › 화면 6

화면 6. Ordered List.initialOrder [sink]

원본: Computation Layer 문서(Ordered List (정렬 리스트)) · Try It (원본 화면)

화면 번호6 / 11
문서 항목 설명 (원문)initialOrder Takes a numberList of where each item should start. Accepts any numberList as an order (with ties leaving two items in order). For example, [3, 1, 2] would mean that the first authored item would go in the last slot, the 2nd in the first slot, and the 3rd in the middle slot. [.25, 0, .25] would mean that the 2nd item goes first, the 1st goes right after, and the 3rd stays 3rd. As soon as a student reorders, the response is locked in and this sink is ignored.

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

화면 6 캡처

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

2. CL이 입력된 곳

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

번호이름종류CL 코드 원문, 번역, 설명
1graph1그래프
# Create a numberList using the order of the 
# items in the component.
▷ 구성요소 안 항목들의 순서로 숫자배열(numberList)을 만든다.
numberList("L"): order1.order
▶ 그래프의 숫자배열 L은 정렬 리스트 order1에서 각 항목의 현재 위치를 나타내는 숫자배열(order1.order)로 한다.
numberList("L")은 그래핑 계산기의 변수 L을 주어진 숫자배열의 내용으로 정한다.
2order1정렬 리스트
# This code sets the initial order of the component
# using the numeric value at each element of the list
# i_{ndex} in the graph
▷ 이 코드는 그래프의 배열(List) i_{ndex}에 있는 각 값을 써서 구성요소의 처음 순서를 정한다.

initialOrder: graph1.numberList("i_{nitial}")
▶ 정렬 리스트의 처음 순서(initialOrder)는 그래프 graph1의 변수 i_{nitial}에 정해진 숫자배열(graph1.numberList("i_{nitial}"))로 한다.
initialOrder는 각 항목이 처음에 놓일 자리를 숫자배열로 받으며, 학생이 순서를 한 번 바꾸면 응답이 확정되어 무시된다. 문서의 예에서 [3, 1, 2]는 처음 항목이 맨 끝 자리, 2번째 항목이 첫 자리, 3번째 항목이 가운데 자리에 놓인다는 뜻이다.
# Note: the order of the list ([3, 1, 2]) does not determine the order # of the component. i.e. the initial order will not be the third item followed # by the first, then the second. Instead it assigns a spot for each item. # The first item will start in the third position, the second item will start # in the first position, and the last item will start in the second position. ▷ 참고: 배열([3, 1, 2])의 순서가 구성요소의 순서를 그대로 정하는 것은 아니다. 즉 처음 순서가 세 번째 항목, 첫 번째 항목, 두 번째 항목 순서가 되는 것이 아니다. 대신 각 항목이 들어갈 자리를 정한다. 첫 번째 항목은 세 번째 자리에서, 두 번째 항목은 첫 번째 자리에서, 마지막 항목은 두 번째 자리에서 시작한다.