← 수업 제작 도구
홈 › Advanced › Interpreting Math

Interpreting Math (수식 해석하기)

원본: Computation Layer 문서(Interpreting Math)

영어 원문 단락 아래에 한국어 풀이를 두었다(번역이 아니라 해석이다). 코드 상자는 원문 그대로이고, 오른쪽 위의 Try It 버튼을 누르면 새 탭에서 그 화면의 번호별 코드 분석이 열린다.

We love when students can express themselves in a variety of ways. Unfortunately, this means extra work for you in building CL scripts that can interpret all of that flexibility. This section can hopefully provide some useful ideas. But first, some principles we like to adhere to: Never incorrectly mark a student wrong! Try to interpret everything students might type. Always test your scripts by trying out lots of student responses before sharing with students. For example, we almost always prefer to look at numericValue from an input rather than expect the exact characters. Not only does this avoid creating bugs when, for example, a student inadvertently types a space, it also invites and celebrates writing expressions (e.g., 4+5) instead of just numbers (e.g., "9").

우리는 학생이 여러 방식으로 자신을 표현하는 것을 좋아한다. 안타깝게도 이것은 그 다양함을 모두 해석하는 CL 스크립트를 만드는 데 일이 더 든다는 뜻이다. 이 부분이 유용한 아이디어를 주기를 바란다. 먼저 우리가 지키려는 원칙이 있다. 학생을 절대 틀린 것으로 잘못 처리하지 않는다! 학생이 입력할 수 있는 모든 것을 해석하려고 노력한다. 학생에게 공유하기 전에 여러 학생 응답을 입력해 보며 스크립트를 항상 테스트한다. 예를 들어 입력의 정확한 글자를 기대하기보다 입력의 numericValue를 보는 방식을 거의 항상 선호한다. 학생이 실수로 공백을 입력해도 오류가 생기지 않을 뿐 아니라, 숫자(예: "9")만이 아니라 식(예: 4+5)을 쓰는 것을 권장하고 환영하게 된다.

Example 1: simpleFunction

예 1: simpleFunction

One powerful way to interpret math is to use our graphing calculator. But this can be challenging. Suppose we want a student to write the equation of a line that passes through the point (1, 3). Here, you could make use of "simpleFunction." That will understand an equation of the form y=3x, or f(x)=3x, or even just 3x. Here's the script in the graph:

수식을 해석하는 강력한 방법 하나는 그래핑 계산기를 쓰는 것이다. 다만 어려울 수 있다. 학생이 점 (1, 3)을 지나는 직선의 방정식을 쓰게 하고 싶다고 하자. 이때 "simpleFunction"을 쓸 수 있다. 이 함수는 y=3x, f(x)=3x, 그냥 3x 꼴의 식을 이해한다. 그래프의 스크립트는 다음과 같다:

Try It ↗
#this just says "don't worry about this for correctness"
readOnly: true
​
#use the function sink. We can then check for correctness easily
function("f"): simpleFunction(exp1.latex)
​

And here's the script on the input:

그리고 입력의 스크립트는 다음과 같다:

Try It ↗
#to check correctness, we're just going to look at the correctness value computed in the graph.
#C is computed to be 1 if correct and 0 otherwise
correct: graph1.number(`C`) = 1
​

Example 2: parseEquation

예 2: parseEquation

Pretty good! But unfortunately simpleFunction requires a line to be written in explicit form. A line like x+y=4 is correct, but simpleFunction doesn't detect it! Another option is to parse the equation and look at the difference function. This one's subtle, so we recommend looking at the graph. This will turn the student equation of x+y=4 into f(x,y) = 4-(x+y). Here's what this looks like in the graph's CL script:

꽤 괜찮다! 하지만 안타깝게도 simpleFunction은 직선이 명시적인 꼴로 적혀 있어야 한다. x+y=4 같은 직선은 맞는 식인데 simpleFunction은 이를 알아보지 못한다! 또 다른 방법은 방정식을 분석(parse)해서 차 함수(difference function)를 보는 것이다. 이 방법은 미묘하니 그래프를 살펴보기를 권한다. 학생의 방정식 x+y=4가 f(x,y) = 4-(x+y)로 바뀐다. 그래프의 CL 스크립트에서는 다음과 같이 보인다:

Try It ↗
#this just says "don't worry about this for correctness"
readOnly: true
​
#use the function sink. We can then check for correctness easily
function("f"): parseEquation(exp1.latex).differenceFunction("x", "y")
​

There are other options too, like the xyLine method, which naturally understands all different forms of lines, but won't work for parabolas, for instance. The method of parsing you use depends on the math you're hoping for. Unfortunately, there's no one size fits all.

다른 선택지도 있다. 예를 들어 xyLine 방법은 직선의 모든 꼴을 자연스럽게 이해하지만 포물선 등에는 쓸 수 없다. 어떤 분석 방법을 쓸지는 기대하는 수학에 따라 다르다. 안타깝게도 모두에게 맞는 하나의 방법은 없다.

Using Patterns

패턴 사용하기(Using Patterns)

Those first examples show how to provide feedback on student responses by numerically evaluating the students' responses. Sometimes you also want to check their exact form. For this, you can try exploring our "patterns" feature, which lets you parse expressions into pieces. Warning: Be very cautious with this feature! It's under development. It's also really easy to accidentally mark student thinking incorrect when it's just in an unexpected form.

앞의 예들은 학생 응답을 수치로 계산해서 피드백을 주는 방법이다. 때로는 응답의 정확한 꼴을 확인하고 싶기도 하다. 이럴 때는 식을 조각으로 분석하는 "patterns" 기능을 써 볼 수 있다. 경고: 이 기능은 매우 조심해서 써야 한다. 아직 개발 중이다. 또 학생의 생각이 예상 밖의 꼴로 적혔을 뿐인데 실수로 틀렸다고 처리하기가 아주 쉽다.

Here's an example of how to check that a response is a simple number. Note that in Desmos, a "number" is a decimal, a fraction, or a mixed number.

다음은 응답이 단순한 숫자인지 확인하는 예이다. Desmos에서 "숫자"는 소수, 분수, 대분수라는 점에 유의한다.

Try It ↗
#this checks whether their expression is just a number. Will exclude e.g. 4+4
isJustANumber = patterns.number.matches(this.latex)
​
#turn off evaluation
disableEvaluation: true
​
#mark correctness
correct: this.numericValue = 10
​
#give the student actionable feedback
submitDisabled: not(isJustANumber)
errorMessage:
  when isJustANumber ""
  otherwise "Enter a number."

You can also pull apart different parts of their expression using patterns. For example, we could grab the numerator and denominator of a fraction as follows:

패턴으로 식의 여러 부분을 나누어 볼 수도 있다. 예를 들어 분수의 분자와 분모를 다음과 같이 가져올 수 있다:

Try It ↗
#this says: look for a number divided by a number.
pattern = patterns.fraction(patterns.number, patterns.number)
​
#check validity
isValid = 
  when pattern.matches(exp1.latex) "yes"
  otherwise "no"
 
#read off the numerator and denominator. sorry this is verbose!
numerator = pattern.parse(exp1.latex).numerator.latex
denominator = pattern.parse(exp1.latex).denominator.latex

Patterns are a beta feature and you should use them carefully! We expect to make them easier to use over time and will be expanding our documentation as we do.

패턴은 베타 기능이니 조심해서 써야 한다. 시간이 지나면서 쓰기 쉽게 만들고 문서도 늘려 갈 예정이다.