Annotation of doc/help/developers/LC2_student_equation_syntax.txt, revision 1.1

1.1     ! damieng     1: STUDENT EQUATION SYNTAX FOR MATHRESPONSE AND FORMULARESPONSE
        !             2: 
        !             3: * mathresponse or formularesponse with a CAS:
        !             4: 
        !             5: Note: by default, formularesponse uses Maxima. mathresponse requires the specification of the CAS.
        !             6: 
        !             7: Processing of the response:
        !             8: 1) separation of the string using the comma separator
        !             9: 2) addition of the implicit operators
        !            10:   a b -> a*b
        !            11:   3 b -> 3*b
        !            12:   3 4 -> 3*4
        !            13:   )( -> )*(
        !            14:   ) ( -> )*(
        !            15:   3a -> 3*a
        !            16:   3( -> 3*(
        !            17:   3 ( -> 3*(
        !            18:   a ( -> a*(
        !            19:   )a -> )*a
        !            20:   )3 -> )*3
        !            21:   ) 3 -> )*3
        !            22: 3) in the case of Maxima, tranformation of pi into %pi
        !            23: 4) run of the CAS with the script and the arguments
        !            24: 5) interpretation of the result: true -> EXACT_ANS, false -> INCORRECT, other -> BAD_FORMULA
        !            25: 
        !            26: Consequences:
        !            27: - the general syntax is the one of the chosen CAS (Maxima or R), with implicit operators
        !            28: - students can use all the CAS functions in the active libraries, except the blacklisted ones and the ones using more than one argument. For instance, "mod(9,5)" will not work because the string is separated into 2 arguments. Some other important Maxima functions that cannot be used: diff, integrate, sum, product, limit, binomial, atan2. With R %% can be used for the modulo.
        !            29: - vectors can only be entered with a comma separated string which has then to be reconstructed with the arguments in the CAS script. A vector with the CAS syntax will not be recognized.
        !            30: - matrices cannot be entered
        !            31: - with Maxima, constants such as inf, minf, und, %e, %i, %pi and pi are recognized. Other constants than pi needing a percent sign, such as e and i, are not recognized.
        !            32: - R recognizes pi, Inf and NaN, but not i or e. Due to the preprocessing, complex numbers cannot be entered.
        !            33: - sometimes the result will be incorrect even though it's a syntax error (for instance when a function name is unknown with Maxima)
        !            34: 
        !            35: 
        !            36: * formularesponse with samples:
        !            37: - parenthesis
        !            38: - implicit operator: *
        !            39: - known operators: + - * / ^ % (modulo)
        !            40: - known constants: only the ones that are explicitely used in the expected answer.
        !            41: - some unknown operators: !
        !            42: - known functions: abs, exp, log (log e), sqrt, factorial, sgn, ceil, floor, erf, erfc, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asin, acosh, atanh
        !            43: - some unknown functions: ln, log10, pow, atan2, min, max
        !            44: Other functions that should not be used by students seem to be recognized, like duration() and problem().
        !            45: It looks like functions with more than one argument (like pow) and functions with digits in the name (like log10) are not recognized, even though CAPA knows about them. Probably because of a preprocessing similar to the one used with CAS.
        !            46: 
        !            47: 
        !            48: * Summary: common features (for formularesponse and mathresponse, Maxima, R or samples):
        !            49: - parenthesis
        !            50: - implicit operator: *
        !            51: - operators: + - * / ^
        !            52: - functions: abs, exp, log (log e), sqrt, factorial, floor, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, asin, acosh, atanh
        !            53: - constants: pi, inf (assuming they are expected to be used when samples are used)
        !            54: 
        !            55: 
        !            56: * Advice for authors
        !            57: - Avoid asking students for expressions that require the use of a feature that does not work with all cases, such as constants other than pi. It makes it easier to switch later from CAS to samples or the other way around. It also keeps the syntax compatible with other LON-CAPA problems.
        !            58: - Add some problems at the beginning of the course to train students to the syntax. In particular, make sure they will not use an expression like "xy" to mean "x*y". For example:
        !            59: /res/msu/kortemey/physicsprecourse/inputpractice/algebraic.problem
        !            60: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>