Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to warn when student uses unusual variable names in a JME part answer. #280

Closed
christianp opened this issue Jul 18, 2013 · 10 comments

Comments

@christianp
Copy link
Member

Motivated by questions where the answer is something like sin(x*y). The student might write sin(xy), and xy is interpreted as a single variable.

The author should be able to give a list of 'expected' variable names for an answer to a question. If anything else is used, the student is shown a warning.

@christianp
Copy link
Member Author

When the author doesn't give any expected variable names, should the default behaviour be to extract them from the correct answer, or not to do anything?

christianp added a commit that referenced this issue Jul 18, 2013
Question authors can provide a list of expected variable names for answers to mathematical expression parts.
If the student's answer includes a variable name which isn't in this list, on submitting the part the student is given a warning that the variable name is unexpected. If the name can sensibly be split up into more than one variable name, the warning suggests something like "did you mean `x*y`?".

If the list of expected names is empty, the check isn't performed and there's no warning.

It doesn't catch bad  function names, for example in `xln(x)`, at the moment. Should it? Is it ever acceptable to use a function name which isn't defined in the questionscope?

ref #280
christianp added a commit to numbas/editor that referenced this issue Jul 18, 2013
@christianp
Copy link
Member Author

I've pushed this to master so you can try it at http://numbas.mas.ncl.ac.uk/question/228/issue-280/. Is it OK?

@BillFoster
Copy link
Contributor

Needs careful testing - I have done some and there are issues, for example, the error message sometimes says that a variable is unexpected - but of course the student sees the variable in the question and it is clearly not unexpected from their point of view. See part 2 of http://numbas.mas.ncl.ac.uk/question/229/bills-copy-of-issue-280/ and answer 2x_y_z. More later.


From: Christian Perfect [notifications@github.com]
Sent: 18 July 2013 15:38
To: numbas/Numbas
Subject: Re: [Numbas] Add option to warn when student uses unusual variable names in a JME part answer. (#280)

I've pushed this to master so you can try it at http://numbas.mas.ncl.ac.uk/question/228/issue-280/. Is it OK?


Reply to this email directly or view it on GitHubhttps://github.com//issues/280#issuecomment-21187905.

@christianp
Copy link
Member Author

"Unexpected" is from the point of view of the marking algorithm: it was expecting only to see x and y, and it saw z as well. What word or phrasing would you prefer?

The other option is to do it the other way round and give a list of variable names that should cause the warning to be shown when they're present, but writing out that list means you need to think of yx as well as xy, and then the combinatorial madness when there are more variables.

@BillFoster
Copy link
Contributor

Not quite, it was expecting in part 2 to only see x , the error message is 'your answer was interpreted to use the unexpected variable name y'
z is not mentioned.
Also the answer is marked as correct and has the above message alongside it.
Also if we do not include any expected variables, as is now the case in the new part 3 of the question, then x_y_z is marked as correct and no message. This is inconsistent so needs thinking about.
(So each math question type has its own list of expected variables?)

Worth taking a little time to mull over this.


From: Christian Perfect [notifications@github.com]
Sent: 18 July 2013 21:36
To: numbas/Numbas
Cc: Bill Foster
Subject: Re: [Numbas] Add option to warn when student uses unusual variable names in a JME part answer. (#280)

"Unexpected" is from the point of view of the marking algorithm: it was expecting only to see x and y, and it saw z as well. What word or phrasing would you prefer?

The other option is to do it the other way round and give a list of variable names that should cause the warning to be shown when they're present, but writing out that list means you need to think of yx as well as xy, and then the combinatorial madness when there are more variables.


Reply to this email directly or view it on GitHubhttps://github.com//issues/280#issuecomment-21212889.

@christianp
Copy link
Member Author

In that part you've only put x as an expected variable name, so it's correctly saying y is unexpected.

Only the first unexpected variable is mentioned. I could make it list them all, but the warning popup box is only small and it might end up being hard to read.

I don't understand what you're trying to do with part 3. The correct answer is x*y*z, so x*y*z is marked correct. Why would there be a message? You haven't set any expected variables.

@BillFoster
Copy link
Contributor

The problem is that in part 3 there are no expected variables, so the way I would read it is that they should be a warning message similar to that of part 2 saying that x, y and z are unexpected!

From: Christian Perfect [mailto:notifications@github.com]
Sent: 18 July 2013 10:50 PM
To: numbas/Numbas
Cc: Bill Foster
Subject: Re: [Numbas] Add option to warn when student uses unusual variable names in a JME part answer. (#280)

In that part you've only put x as an expected variable name, so it's correctly saying y is unexpected.

Only the first unexpected variable is mentioned. I could make it list them all, but the warning popup box is only small and it might end up being hard to read.

I don't understand what you're trying to do with part 3. The correct answer is x_y_z, so x_y_z is marked correct. Why would there be a message? You haven't set any expected variables.


Reply to this email directly or view it on GitHubhttps://github.com//issues/280#issuecomment-21217583.

@christianp
Copy link
Member Author

You're right, it's a bad design I thought I could get away with. I'll add a
toggle option for the check, and an empty list will mean any variable
prompts the warning.
On 19 Jul 2013 08:42, "Bill Foster" notifications@github.com wrote:

The problem is that in part 3 there are no expected variables, so the way
I would read it is that they should be a warning message similar to that of
part 2 saying that x, y and z are unexpected!

From: Christian Perfect [mailto:notifications@github.com]
Sent: 18 July 2013 10:50 PM
To: numbas/Numbas
Cc: Bill Foster
Subject: Re: [Numbas] Add option to warn when student uses unusual
variable names in a JME part answer. (#280)

In that part you've only put x as an expected variable name, so it's
correctly saying y is unexpected.

Only the first unexpected variable is mentioned. I could make it list them
all, but the warning popup box is only small and it might end up being hard
to read.

I don't understand what you're trying to do with part 3. The correct
answer is x_y_z, so x_y_z is marked correct. Why would there be a message?
You haven't set any expected variables.


Reply to this email directly or view it on GitHub<
https://github.com/numbas/Numbas/issues/280#issuecomment-21217583>.


Reply to this email directly or view it on GitHubhttps://github.com//issues/280#issuecomment-21235964
.

@christianp
Copy link
Member Author

I've documented the expected variable names at http://numbas-editor.readthedocs.org/en/latest/question-parts.html#mathematical-expression. Should I close this now?

@BillFoster
Copy link
Contributor

Yes.

From: Christian Perfect [mailto:notifications@github.com]
Sent: 21 August 2013 11:03 AM
To: numbas/Numbas
Cc: Bill Foster
Subject: Re: [Numbas] Add option to warn when student uses unusual variable names in a JME part answer. (#280)

I've documented the expected variable names at http://numbas-editor.readthedocs.org/en/latest/question-parts.html#mathematical-expression. Should I close this now?


Reply to this email directly or view it on GitHubhttps://github.com//issues/280#issuecomment-23006948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants