Forum

Please note that you can subscribe to the individual forums. A subscription for news only covers the news.

Wish: Input#=# nega...
 
Notifications
Clear all

Wish: Input#=# negative value

3 Posts
2 Users
0 Likes
183 Views
0
Topic starter

Hi

Just rolled out a new maths test. Days in the making. Hours crossing the syntax checker. Neither sub nor sir knows the half of it. Anyway, a snag: I forgot that you cannot input a negative number. Could this be changed? 

Input#=#YourAns,{#Num1} - {#Num2}=
Case=First
When=#YourAns=#TheAns
               Add#=#MathsResult,1
When=None
               Subtract#=#MathsResult,1
Case=End

#TheAns can be negative but #YourAns cannot accept a negative.

Solution?
1. When=#TheAns<0, Multiply#=#YourAns,-1. Sub needs advising to ignore the negative, and it feels uncomfortable. In a bad way.

2. Offer the opportunity on every answer to multiply by -1. This seems tedious and it offers an unwanted hint to the Sub.

3. Multiple choice Qs? Too easy. 

Any ideas welcome.

Topic Tags
3 Answers
0

I wonder why I made that restriction. It is clearly a deliberate choice. Probably because in the use cases I could imagine, negative numbers would be meaningless. "How many cookies did you eat"? "-3". "Then I will add -3 to the number of beats you will receive" 😉 

But I realise that there may be reasons for entering negative numbers. I will see if I can find a solution.

With the current program, I cannot think of other solutions than what you have listed.

Sven

 

0
Topic starter

Thanks for your response. Even with the polarity help, the test is still corrective.  

Negative cookies? I took three. But I made these! 

0

Hi Simon,

The new version, 4.3.9, has a new keyword, InputNeg#, which is identical to Input#, except that it allows negative numbers.

Sven