[LON-CAPA-users] cleaning up submissions for numerical response problems

Mills, Douglas G dmills at illinois.edu
Thu Dec 11 17:59:38 EST 2014


Am I right in thinking that &submission is not an option for retrieving
data from separate problems in a sequence as opposed to retrieving answers
from other responses all in the same problem?


Douglas Mills
Director of Instructional Technologies
Department of Chemistry
University of Illinois
dmills at illinois.edu
(217) 244-5739

On 12/11/14, 2:39 PM, "Stuart Raeburn" <raeburn at msu.edu> wrote:

>> Any help or comments regarding any submission handling would be
>The CAPA engine which determines correctness of submissions for
>numericalresponse items (amongst others) tries its best to extract a
>number from data submitted by the student. However, LON-CAPA
>faithfully records the learner's actual submission.
>Accordingly, it is possible, as you have found, for a student to
>provide some misshapen input in an initial part in a multi-part
>problem, which LON-CAPA grades as correct, but then when you come to
>use that submission in a perl script block for a subsequent part, it
>does not behave as you might expect.
>See comment #3 in bug 6614 --
>There are three related enhancement requests: 6609, 6613 and 6614 (all
>resolved in 2.11.0), with option (b) below.
>Your options are:
>(a) Include a preprocessor routine. (There is a problem template:
>"Numerical Response with Pre-Processing" which is an example of this
>functionality). The "preprocess" attribute was first included in
>LON-CAPA 2.10.1
>(b) Retrieve the student's previously submitted data using
>&submission() in place of &EXT(), and specify desired clean-up in the
>optional fifth argument in the call to &submission(). This fifth
>argument is a reference to a hash, with one or more of the following
>keys => values:
>   exponent => 1, comma => 1, letterforzero => 1, spaces => 1, format =>
>   (where n is an integer, i.e., number of significant digits).
>An example call, where part id of first part is "one", and response ID of
>numericalresponse in that part is "11" would be:
>$first = &submission('one','11','','',{exponent => 1, comma => 1,
>=> 1, spaces => 1, format => '3s'});
>with spaces => 1 included:
>0. 44 in learner data would be converted to 0.44
>This fifth argument in &submission() was first included in LON-CAPA
>If you want to try this out, but your library server is running
>2.10.1, visit: https://testdrive.loncapa.org/ and create a username
>and authoring space in the testdrive domain (not connected to the main
>LON-CAPA network) - running 2.11.0.
>(c) Create your own clean-up routines (e.g., in a .library file) and
>import the file into your problems, and then within the script block
>call the routine you created to clean up the learner data.
>or some combination of two or more of (a), (b), and (c).
>Some time I ago I created a library file containing a routine:
>&cleaneq() which could be used to clean up algebraic expressions.
>This file is published source XML open, so select an author role, and
>then browse the /res/msu/raeburn/ directory in the shared repository
>with the "Source Available" checkbox checked, and you will be able to
>click on "Source Code" to pop-open a window displaying the perl
>regular expressions used in the cleaneq routine in the cleaneq.library
>Stuart Raeburn
>LON-CAPA Academic Consortium
>Quoting Bob Gonzales <rgonzal at binghamton.edu>:
>> Hi,
>> I'd like to look at the code that Loncapa uses to clean up submissions
>> numerical response problems.  I'm referring to clean-up actions like
>> converting exponents from '1x10^1' to '1e1' and removing leading '+'
>> We have some lab exercises in which we use the student's entered data
>> some numerical response problems.  I'm getting the previously submitted
>> data  via the &EXT() function.
>> Every once in a while a student will submit their data with something
>> a leading '+' sign, which Loncapa cleans up, and the data is accepted as
>> correct.  So, it would be good for me to do the same clean up before I
>> the submission.
>> I've looked around in the system and I see some cleanup in the
>> 'implicit_multiplication' routine in 'caparesponse.pm'  but I'm not sure
>> I'm even in the right place.
>> Any help or comments regarding any submission handling would be
>> Thanks,
>> Bob Gonzales
>> Chemistry Dept
>> Binghamton University
>LON-CAPA-users mailing list
>LON-CAPA-users at mail.lon-capa.org

More information about the LON-CAPA-users mailing list