← 수업 제작 도구
홈 › Getting Started › Correctness

Correctness (정답 판정)

원본: Computation Layer 문서(Correctness)

코드 상자는 원문 그대로이다.

Checking student responses for correctness is a great way to both provide students with feedback and help teachers quickly see correctness in the teacher dashboard.

학생 응답의 정답 여부를 확인하면 학생에게 피드백을 줄 수 있고, 교사도 교사 대시보드에서 정답 여부를 빠르게 볼 수 있다.

In general, we recommend being very careful when adding correctness checks to an activity. Computers are pretty dumb and might mark work wrong when a human would mark it correct, which is a really demoralizing experience for students. Here are a few tips for writing correctness.

활동에 정답 판정을 넣을 때는 아주 조심하기를 권한다. 컴퓨터는 꽤 단순해서 사람이라면 맞다고 할 답을 틀렸다고 판정할 수 있고, 이런 일은 학생의 의욕을 크게 꺾는다. 다음은 정답 판정을 쓸 때의 몇 가지 팁이다.

Compare Values

값 비교하기

If you want to check that a student got a number right, you can compare its value. This is generally safe if the answer is an integer, but risky otherwise! Always test it out yourself with a few values you expect to work. Here's a very simple example of checking whether the value is greater than 7:

학생이 숫자를 맞혔는지 확인하려면 그 값을 비교하면 된다. 답이 정수이면 대체로 안전하지만, 그렇지 않으면 위험하다! 맞다고 판정되어야 할 값 몇 개로 항상 직접 시험해 본다. 다음은 값이 7보다 큰지 확인하는 아주 간단한 예이다.

#define a variable to test correctness
#note: we can use this value elsewhere since it's a variable.
correct = this.numericValue > 7
​
#populate the "correct" SINK for this component.
#this will update what you see in the teacher dashboard
#note the use of sink (correct:) and variable (correct =)
correct: correct

We can reuse that computation to create a feedback string in a note:

이 계산 결과를 다시 써서 메모에 피드백 글자를 만들 수 있다.

#read off correctness from a different component
#save as a variable the note can use.
feedback =
  when exp1.script.correct "That's correct!"
  otherwise "Not correct yet."

Use the Graphing Calculator

그래핑 계산기 사용하기

For more complicated examples of correctness, one nice technique is to use the graphing calculator. We like to use movable points with a step set on sliders to enable snapping.

더 복잡한 정답 판정에는 그래핑 계산기를 쓰는 것이 좋은 방법이다. 움직이는 점을 쓰고, 슬라이더에 간격(step)을 정해 점이 정해진 값에 딱 맞춰지게(snapping) 하는 방법을 권한다.

In this example, we want a slope of 2. The graph computes the slope using a variable called m, and then uses snapping. The Computation Layer is just this line:

이 예에서는 기울기가 2이기를 원한다. 그래프는 m이라는 변수로 기울기를 계산하고, 점이 정해진 값에 맞춰지게 한다. Computation Layer는 다음 줄뿐이다.

#define a local correctness variable:
isCorrect = this.number("m") = 2
​
#populate the correct sink, for the dashboard
correct: isCorrect

Use Conditionals

조건문 사용하기

For more advanced correctness in the calculator, you can use conditionals. Build in a little tolerance for extra safety (e.g., C={|a-7.4| ≤ 0.1: 1, 0}).

계산기에서 더 고급 정답 판정을 하려면 조건문을 쓸 수 있다. 안전을 위해 약간의 허용 오차를 둔다(예: C={|a-7.4| ≤ 0.1: 1, 0}).

Most importantly, always try your correctness checks yourself with a range of inputs before giving them to students!

무엇보다 정답 판정은 학생에게 주기 전에 항상 여러 가지 입력으로 직접 시험해 본다!