Welcome, Guest
Username: Password: Remember me

TOPIC: expression manager problem.

expression manager problem. 6 months 2 weeks ago #100273

  • limesun
  • limesun's Avatar
i set assessment value for each question.
sometimes i use {sum(q1,q2)},can get the assessment value sum.
sometimes i can't. should change to {sum(q1.value,q2.value)}.
what's the problem.i am not sure about it.
The administrator has disabled public write access.

expression manager problem. 6 months 2 weeks ago #100278

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
Dear limesun,

q1 (same as q1.code and q1.NAOK) will return the answer code of the answer selected in q1. The function sum() ignores all values which are not numeric. Therefore, your assessment values will only be correct if your codes in q1 and q2 are numeric.

Example:
sum(1,2) = 3
sum(1,'a') = 1

Best
jonsen
The administrator has disabled public write access.

expression manager problem. 6 months 2 weeks ago #100280

  • limesun
  • limesun's Avatar
normally, the q1.code is not number,like A1,L001.
when the assessment code is A1, i can get the sum(q1,q2)
when the assessment code is LOO1,the sum(q1,q2) is 0.
i guess it's a bug??
The administrator has disabled public write access.

expression manager problem. 6 months 2 weeks ago #100282

  • jonsen
  • jonsen's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 61
  • Thank you received: 2
  • Karma: 0
Using Version 2.00+ Build 130923 I entered the following formulas:

sum(1,2,7,'a') = {sum(1,2,7,'a')}
sum(1,2,7,'L1') = {sum(1,2,7,'L1')}
sum(1,2,7,'L001') = {sum(1,2,7,'L001')}
sum(1,2,7,'L001L') = {sum(1,2,7,'L001L')}
sum(1,2,7,'LOO1') = {sum(1,2,7,'LOO1')}
sum(1,2,7,'001') = {sum(1,2,7,'001')}
sum(1,2,7,'001a') = {sum(1,2,7,'001a')}

...and the result was:

sum(1,2,7,'a') = 10
sum(1,2,7,'L1') = 10
sum(1,2,7,'L001') = 10
sum(1,2,7,'L001L') = 10
sum(1,2,7,'LOO1') = 10
sum(1,2,7,'001') = 11
sum(1,2,7,'001a') = 11 <-- the chars are considered numeric until the first non-numeric string.

This is what I expected. I don't know why you would get anything else...
The administrator has disabled public write access.

expression manager problem. 6 months 2 weeks ago #100283

  • limesun
  • limesun's Avatar
thanks for your reply.
i only calculate the assessment value.
then
{sum(q1.value,q2.value,q3.value,....q80.value)}
oh my god,such a long expression.
because LS doesnot support {sum(group1.value)}
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.093 seconds
Donation Image