[LON-CAPA-users] using &submission() between problems

Stuart Raeburn raeburn at msu.edu
Tue Dec 15 14:43:43 EST 2015


Doug,

For the purposes of re-usability, if an authored LON-CAPA problem  
incorporates dependencies on a student's submission(s) to other  
problem(s) in the current course, then arguably you should be working  
with published sequences, and you should be importing those published  
sequences into the course.

For the case of a published sequence imported into a course the symb  
will *not* contain the course ID, so yes it is independent of the  
course.  However, it is not true to say that it is unique to the  
resource, as it is in fact unique to the instance of the resource.

A symb is constructed from map___id___res, where map is the enclosing  
sequence (or composite page), id is the unique id assigned to the  
resource in the map, and res is the resource.  So you could have two  
different published maps in a course, with both containing the same  
resource, but each instance of the resource would have a unique symb  
(maps will be different).  Similarly, you could have a single sequence  
in a course containing multiple instances of the same resource, and  
again, each instance would be unique (the ids would be different).

Anyway, because the symb needs to be unique, quite a number of lines  
of LON-CAPA code are employed in ensuring that you do not end up with  
two instances of the same published map in a single course, when using  
the Course Editor clipboard to copy and paste with nested folders.

In my previous reply I mentioned that if you are using folders  
generated in the Course Editor instead of published sequences then  
there is no support for mapaliases, and you need to use a symb.

Of course, the problem with the symb in this case, is that it does  
include the course ID, which means that authored resources that  
include calls to &submission() in the script block, and have a  
hard-coded symb as the sixth argument are not going to be re-usable.  
If you built resources that way (I wouldn't recommend it), you would  
want to publish with custom rights, with use restricted to a single  
course (i.e., the one featured in the symb arg in &submission() calls).

It is actually possible to use Simple Problems within a course (with  
type set to numerical) and within the Scripting section include calls  
to &submission() which contain a sixth arg, providing the symb for  
another resource in a folder in the course, e.g.,

$a = &submission('numerical','numericalsegment','',  
'','','uploaded/msu/40326912a251e547fmsul1/default_1449967894.sequence___6___lib/templates/simpleproblem.problem');

But that's counter to the LON-CAPA philosophy of re-usability.


Stuart Raeburn
LON-CAPA Academic Consortium


Quoting "Mills, Douglas G" <dmills at illinois.edu>:

> Just to confirm -- it appears to me that the symb is unique to the
> resource and independent of the course, is that correct?
>
> Thanks,
>
> Doug
>
> Douglas Mills
> Director of Instructional Technology
> Department of Chemistry
> University of Illinois
>
>
>
>
>
>
>
> On 12/14/15, 4:57 PM, "lon-capa-users-bounces at mail.lon-capa.org on behalf
> of Stuart Raeburn" <lon-capa-users-bounces at mail.lon-capa.org on behalf of
> raeburn at msu.edu> wrote:
>
>> Bob,
>>
>> The syntax is described in the LON-CAPA Script Functions help item:
>> e.g.,
>> http://loncapa.chem.binghamton.edu/adm/help/Problem_LON-CAPA_Functions.hlp
>>
>> To access a student's submissions in a different problem you need to
>> supply a sixth argument -- a maplias, and the call is:
>>
>> &submission($partid,$responseid,$version,$encode,$cleanupnum,$mapalias);
>>
>> In the case of a published sequence, where you have authoring or
>> co-authoring rights, you can set a mapalias for a particular resource
>> in the sequence using the Advanced Editor in Authoring Space (prior to
>> publication).
>>
>> If there is no mapalias set you can use the (much longer) unique
>> identifier of the resource instance (known as the "symb"). If you are
>> using a folder added via the Course Editor rather than a published
>> sequence, there is currently no mechanism to set a mapalias for a
>> particular resource instance in the folder (which is actually still a
>> sequence internally in LON-CAPA), so you will have to use the "symb".
>>
>> You can display a list of "symb"s in a course using:
>> Course Editor > Content Utilities >  List Resource Identifiers
>> (the "symb"s are in the "Identifier" column).
>>
>>
>> Stuart Raeburn
>> LON-CAPA Academic Consortium
>>
>>
>> Quoting Bob Gonzales <rgonzal at binghamton.edu>:
>>
>>> Hi,
>>>
>>> The release notes for 2.11.1 say this about &submission():
>>>
>>> &submission() in one problem can access submissions by the same student
>>>     in a different problem.
>>>
>>> Does this mean any problems in a course that the student has access to
>>> or
>>> do the problems still have to be in a sequence?
>>>
>>> If a sequence is not required then what would be the the syntax of the
>>> call?
>>>
>>> Thanks,
>>> Bob Gonzales
>>> Binghamton University
>>> Chemistry Dept
>>
>> _______________________________________________
>> LON-CAPA-users mailing list
>> LON-CAPA-users at mail.lon-capa.org
>> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users



More information about the LON-CAPA-users mailing list