Doug,

Yes, you can pass a mapalias as the second argument to a call to &EXT() in one problem to retrieve information for the current user about another problem in the same course.

See:

http://mail.lon-capa.org/pipermail/lon-capa-users/2012-April/003965.html

for details.

To do this you need to have used the Advanced Editor in Authoring Space to have assigned a mapalias to the particular resource in a sequence, and have published the sequence, and then imported the sequence into the course. Each mapalias used in a course needs to be unique.


Here's a line of my code:

$award=&EXT('user.resource.resource.11.awarded','postlab3');


This would retrieve the current user's awarded value (0 or 1, unless lenient grading in use for optionresponse or matchresponse) for part 11 of the resource with a mapalias of postlab3 (set in the enclosing published/imported folder).

In course context, if you display the resource for which the postlab3 mapalias is set, when you can click "Content Settings" in the gray Functions bar to display parameters set for that item, you should see postlab3 listed in the second pink column, i.e., Resource Level -- from Enclosing Map or Folder. This is uneditable in course context.

Notes:

1. Although there is a wrench icon in the "in Course" -- "for Resource" column for the mapalias parameter, setting a value here has no effect, and that may be the cause of your problem.

2. If you have set a mapalias "in Course" -- "for Resource" for the current resource, and included that mapalias for the second argument in the &EXT() call in the problem, when that &EXT() call is evaluated during rendering, the unique identifier retrieved based on the mapalias will be empty, and so the problem will default to retrieving the awarded value for the current resource.

I have filed a bug (#6853) to disable the ability to set a course-specific mapalias in the parameter manager. That said, I am going to enable the ability to set a mapalias in the Course Editor, so that it will be possible to use aliases for resources without needing to use imported maps.

See:
http://mail.lon-capa.org/pipermail/lon-capa-users/2015-December/005020.html

for some context on that.


Stuart Raeburn
LON-CAPA Academic Consortium


Hi All,

I thought I had done this before but for some reason I seem unable to access information from an aliased resource in the same course but in a different sequence from the one the resource I'm trying to access it from is in... Here's a line of my code:

$award=&EXT('user.resource.resource.11.awarded','postlab3');

I'm using this same code (with a different alias) to get information from other problems within the sequence, but this seems to be failing. "postlab3" > is aliased inside the lab3 sequence. I'm in a problem inside the lab4 sequence. Is that the issue? I've seen before that courses will complain if > you have overlapping alias names despite them being in different sequences indicating that mapaliases have to be unique across the course. I assumed from that that they could be referenced from across the course and not just > within a sequence. I *thought* I had done that successfully before, but I might be mistaken.

Thank you for any guidance that can be provided!


Doug

Douglas Mills
Director of Instructional Technology
Department of Chemistry
University of Illinois

_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

Reply via email to