<adlcp:map> in scorm 2004 4th edition - testing

We are building API for scorm 2004 4th edition , we start using the the official Test Suite but in the DMI test we get the following error :
"ERROR: Attempted to access an objective with the id "tarID1" but "tarID1" was not found."
when i looked in the manifest xml file i found that those elements are defined as "adlcp:map" , where shall i save this tag ? what this tag represent ?

Anything you would want to know about any element in a manifest (assuming it doesn't utilize third-party extensions) can be found in the official SCORM documentation.
Download the documentation suite. In the CAM book, look for section 3.4.1.19, titled "<map> Element".
Source: SCORM 2004 4th Edition Content Aggregation Model (CAM) Book, available from adlnet.gov (download the documentation suite).

This is used for shared buckets, or data which can be accessed and set across courses/SCO's. For example, you might have a pretest and need that score/user answers in another SCO for providing feedback.
For those looking for more info on implementation:
Add this to your item (organisation > item) in the manifest:
<adlcp:data>
<adlcp:map targetID="mybucketname" readSharedData="true" writeSharedData="true"/>
</adlcp:data>
JS part (Use your API calls in place of LMSGetValue and LMSSetValue)
var dataBucketsCount = LMSGetValue("adl.data._count");
dataBucketsCount = parseInt(dataBucketsCount);
for (var i=0; i < dataBucketsCount; i++){
if (LMSGetValue("adl.data." + i + ".id") == "mybucketname"){
//do your processing with the data
}
}
You can google for RTE Handbook SCORM 2004 4th edition, to get details on the manifest elements.
However this is a lovely way to save data from one course and get it in other, provided your LMS supports it. Also, the character limit is same as suspend data.

Related

Error while exporting TXTextControl as PDFA or XML

i gain a strange error: 'This feature is not available in the TX Text Control Standard or Professional version. The TX Text Control Enterprise version must be installed.' when I try to save the TXTextControl object with .Save function in .pdfa, .xml and other formats. The error comes when I explicit the StreamType parameter in the .Save function. It seems I have not all the format offered by TXTextControl.
Error comes in this line for example:
TXTextControl.Save(dir, TXTextControl.StreamType.XMLFormat)
or
TXTextControl.Save(dir, TXTextControl.StreamType.AdobePDFA)
I searched online but I can't find references to this error and for TXTextControl enterprise or professional version.
There 's actually different versions of TXTextControl? How can I verify what version I have?
Thanks.
Using TXTextControl.GetVersionInfo().Level should tell you what level you have (as per ProductLevel property)
If you look at the Features page and open up the Supported Formats section under "Features in Detail" then you can see which formats your product level supports.

ZeroBrane : Register APIs on a per file basis

I'm writing a ZeroBrane Studio plugin for our Solarus Game Engine and It works like a charm. Autocompletion included.
I'm wondering now if it's do-able to register lua APIs for one file only.
I need this to offer autocompletion/documentation on global symbols that may vary per-script but are deducible from annex files from the engine.
To summary : Is it possible to register an api for a single file? For example in the onEditorLoad() event.
Thanks.
Greg
EDIT:
I tried the following without sucess:
local function switch_editor(editor)
if current_editor == editor then
ide:Print("same editor")
return
end
current_editor = editor
if not editor then
ide:Print("null ed")
return
end
lua_file_path = ide:GetDocument(editor).filePath
if lua_file_path:match('/data/maps/') then
ide:Print("map file!",type(editor))
local map_api = make_map_api(lua_file_path)
current_api = map_api
ide:AddAPI('lua','solarus_map',map_api)
else
ide:Print('other file')
if current_api then
ide:RemoveAPI('lua','solarus_map')
current_api = nil
end
end
end
api = {"baselib", "solarus", "solarus_map"}, --in interpreter table
... -- in the plugin table :
onEditorFocusSet = function(self,editor)
switch_editor(editor)
end,
Completion with the solarus api works fine but the on-fly registration of the solarus_map api seem not to be taken in account.
EDIT2:
Silly my, I must have done a typo, because after checking and rewriting some things pretty much as in the code pasted above... it works! Awesome!
The only small gotcha is that when switching to a file where I don't want the solarus_map API... ide:RemoveAPI isn't sufficient. Instead I must do ide:AddAPI('lua','solarus_map',{}) to replace the API with an empty one. Which I can live with.
To summary, to achieve a custom api which change from file to file:
Add the api name to the interpreter
In the onEditorFocusSet event, update the API with ide:AddAPI(...), eventually setting it to {} if it needs to be empty/disabled.
Code sample in the editions of my Question.

How do I find the version and authority of a Perl 6 module?

In Bar.pm, I declare a class with an authority (author) and a version:
class Bar:auth<Camelia>:ver<4.8.12> {
}
If I use it in a program, how do I see which version of a module I'm using, who wrote it, and how the module loader found it? As always, links to documentation are important.
This question was also asked on perl6-users but died before a satisfactory answer (or links to docs) appeared.
Another wrinkle in this problem is that many people aren't adding that information to their class or module definitions. It shows up in the META.json file but not the code.
(Probably not a satisfying answer, because the facts of the matter are not very satisfying, especially regarding the state of the documentation, but here it goes...)
If the module or class was versioned directly in the source code à la class Bar:auth<Camelia>:ver<4.8.12>, then any code that imports it can introspect it:
use Bar;
say Bar.^ver; # v4.8.12
say Bar.^auth; # Camelia
# ...which is short for:
say Bar.HOW.ver(Bar); # v4.8.12
say Bar.HOW.auth(Bar); # Camelia
The ver and auth methods are provided by:
Metamodel::ClassHOW (although that documentation page doesn't mention them yet)
Metamodel::ModuleHOW (although that documentation page doesn't exist at all yet)
Unfortunately, I don't think the meta-object currently provides a way to get at the source path of the module/class.
By manually going through the steps that use and require take to load compilation units, you can at least get at the prefix path (i.e. which location from $PERL6LIB or use lib or -I etc. it was loaded from):
my $comp-spec = CompUnit::DependencySpecification.new: short-name => 'Bar';
my $comp-unit = $*REPO.resolve: $comp-spec;
my $comp-repo = $comp-unit.repo;
say $comp-repo.path-spec; # file#/home/smls/dev/lib
say $comp-repo.prefix; # "/home/smls/dev/lib".IO
$comp-unit is an object of type CompUnit.
$comp-repo is a CompUnit::Repository::FileSystem.
Both documentations pages don't exist yet, and $*REPO is only briefly mentioned in the list of dynamic variables.
If the module is part of a properly set-up distribution, you can get at the meta-info defined in its META6.json (as posted by Lloyd Fournier in the mailing list thread you mentioned):
if try $comp-unit.distribution.meta -> %dist-meta {
say %dist-meta<ver>;
say %dist-meta<auth>;
say %dist-meta<license>;
}

RavenDB Studio - Patch can't find this.__document_id

I'm trying to write a patch over a Collection that involves getting the current document ID and I was trying to test it to see the output in the RavenDB Studio Patch area which does a good job of showing before and after. I couldn't understand why my script wasn't working the way I expect and I managed to narrow it down to this small piece:
this.TestId = this.__document_id
In the output for my document when running the test is:
TestId: null
But I can see the document Id is users/1234. Does anyone know the correct syntax to pull the document Id out in the JavaScript used by the RavenDB Studio?
RavenDB Version: #2230
Remove the 'this' in front of the '__document_id'.
this.TestId = __document_id

How to get started with EPL, Visual Basic, and Zebra Printing?

I can't really find anything on how to print through EPL with Visual Basic. Can anyone help me write some simple text to the printer? I found the Zebra EPL manual so I think I can go from there, I just don't know how to get it started.
The way I do it is using the FSO to do a filecopy from of the label text file to the UNC path of the printer. (i.e. FSO.copyfile filepath, UNCpath).
Create a string with the EPL raw file (text) in it. Save it to a temp file then do the copyfile I mentioned above.
What I have found is that the best way to learn what the EPL is doing is to take an existing string and just play with the settings. Here is a sample FedEx label in EPL for you to start with. Remember - its just text.
(between the 2 'N's)
N
OD10
q812
Q1624,24
D15
ZB
LO0,459,800,4
LO0,713,800,4
LO0,1048,800,4
A35,321,0,2,1,1,N,"From:"
A35,340,0,2,1,1,N,"SHIPPING DEPT"
A35,360,0,2,1,1,N,"Company INC."
A35,380,0,2,1,1,N,"1820 SMARKET BLVD"
A35,401,0,2,1,1,N,""
A35,441,0,2,1,1,N,"(800) 999-9997"
A490,381,0,2,1,1,N,"CAD: 12345/FXRS1060"
A43,500,0,4,1,1,N,"TEST"
A43,535,0,4,1,1,N,"123-45TH"
A43,570,0,4,1,1,N,""
A35,421,0,2,1,1,N,"CHANHASSEN, MN 55317"
A490,340,0,2,1,1,N,"Ship Date: 24NOV10"
A490,360,0,2,1,1,N,"ActWgt: 12.0 LB"
A43,465,0,4,1,1,N,"TEST"
A615,465,0,2,1,1,N,"(320) 555-1212"
A43,608,0,3,1,2,N,"ST CLOUD, MN 56301"
A530,608,0,2,2,2,N,"(US)"
LO670,550,105,10
LO670,560,10,112
LO765,560,10,112
LO670,672,105,10
LO476,315,4,145
A650,485,0,3,2,2,N,"FedEx"
A690,568,0,5,2,2,N,"G"
B80,1083,0,1E,4,2,290,N,"9612304400426670000014"
A135,1397,0,4,1,1,N,"(9612302) 4000266 70000014"
A783,700,3,1,1,1,N,"J10100912242124"
A10,470,0,3,1,1,N,"TO"
A25,1420,0,3,1,1,N,"GND"
A25,1445,0,3,1,1,N,"Prepaid"
A300,1425,0,3,1,1,N,"Hazmat"
A300,1447,0,3,1,1,N,"DIRECT SIGN"
b50,740,P,800,800,s5,f0,x2,y10,r80,o0,l12,"[)>010256301840302400426670000014FDEB40042663281/112.0LBN123-45THST CLOUDMNTEST0610ZGD00411ZTEST12Z320555121223ZN22ZN20Z0.0009KTEST99ZGHAZ028004249300 26Z822a"
A645,1400,0,5,1,1,R,"HAZ"
A580,1457,0,2,1,1,N,"Emergency Contact#"
A580,1477,0,2,1,1,N,"8004249300"
A16,670,0,1,1,1,N,"Ref: TEST"
A16,685,0,1,1,1,N,"INV: "
A16,700,0,1,1,1,N,"PO: TEST"
A406,700,0,1,1,1,N,"Dept: "
P1
N
As you can see the Coordinates are the first 2 sets per line.
A indicates text I believe.
b indicates barcode.
I dont know all the parameters off the top of my head, but you mentioned you had a manual so it should list those details for you.
Hope this helps.
Here's a great blog post by Nicholas Piasecki how to send EPL code to the printer:
Sending Raw EPL2 Directly to a Zebra LP2844 via C#
I was using Zebra printers before (so I already knew EPL), but when I had to print from .NET the first time, I managed to get it to work just with the information from this blog post.
Note that the example code is in C#, but you can translate that to VB.NET.
(the post also mentions an external class named RawPrinterHelper which you can download from Microsoft - if you don't want to translate this to VB, just put it into a separate C# assembly and reference that in your VB project)
If you need to print images too, here's another blog post by the same guy about this:
Using the EPL2 GW command to send an image to a Zebra thermal printer