LMS cmi.suspend_data not stored - scorm2004

I would like to store data in our ILIAS LMS with cmi.suspend_data, but the string e.g. "L_0_0_0_0_0_0_0" is not stored at all.
The commit I have done.

Tips -
Check what mode you are in cmi.mode. If you are in browse or review modes you will not be able to set any data.
Check error codes. This may give you some tip as to either the above, or other issues reported. That string is not over 64,000 characters and appears legal, so var ec = lms.GetLastError(); will get you a string code, and use that to get the message var msg = lms.GetErrorString(ec);
Keep in mind my 'lms' API example is the resolved connection to the API_1484_11 and not an actual 'thing'. So replace that with your local var.
I have a bookmarklet here https://www.cybercussion.com/bookmarklets/SCORM/ which may allow you some transparency finding out what mode you are in when viewing the content.
Good luck

Related

Gatling session variable gets overwritten for multiple users. How to fix this?

So i am an absolute newbie to gatling and the documentation on their site is pretty meh. My scenario is that i have different users which execute one scenario each and during these scenarios they make requests and save the answer in a session variable which they need as a parameter for a following request during the same scenario. My problem is that i have multiple users running at the same time and these overwrite the session variable so that a user which started earlier refers to the wrong value in the session variable. my idea was to set up a global counter which increments as soon as a new user is initialized and starts with his scenario and to append this counter to the session variable. is this possible and if so how do i do it? i bet there is a way better way to fix this behaviour but as i said i have zero experience with gatling and how its working.
my users look like this
user("singleUpload")
.behavior {
feed(applicationCredentials)
.exec(USingleUpload.singleUpload)
the scenarios like this
val singleUpload = exec(RUpload.post)
.exec(RShare.get)
.exec(RDownload.get)
.doIfEquals("${attachmentSingleUpload}", "attachment.jpg") {
exec(RThumbnailDownload.get)
}
.doIfEquals("${attachmentSingleUpload}", "attachment.png") {
exec(RThumbnailDownload.get)
}
.exec(RDelete.delete)
and the request like this:
val attachment = ("attachment", "${attachmentSingleUpload}")
val post = http("RUpload")
.post("/attachment/upload/")
.queryParam("share", "true")
.formUpload("attachment", s"attachments/${attachment._2}")
.header("x-api-key", "${apiKey}")
.header("x-app-id", "${appId}")
.check(status.is(200))
.check(jsonPath("$..pkey").exists.saveAs("pkey"))
val get = http("RShare")
.get("/attachment/share")
.queryParam("pkey", "${pkey}")
.header("x-api-key", "${apiKey}")
.header("x-app-id", "${appId}")
.check(status.is(200))
.check(jsonPath("$..skey").exists.saveAs("skey"))
for example: i make an upload and save the pkey which i then use in the request to get an skey. if user #2 is fast enough with his upload to overwritter the pkey variable in the session then user #1 uses a wrong pkey in his request.
user("singleUpload")
.behavior {
There's neither user nor behavior methods in Gatling's API. If you really have this in your code, these are private customizations. Can't say what they do or if they're correct.
My problem is that i have multiple users running at the same time and these overwrite the session variable so that a user which started earlier refers to the wrong value in the session variable.
if user #2 is fast enough with his upload to overwritter the pkey variable in the session then user #1 uses a wrong pkey in his request.
This is absolutely impossible. Each virtual user has its own Session, isolated from the others'. You cannot store something in a given virtual user's Session and have another virtual user overwrite it. And there's absolutely zero chance of a bug in there.
I recommend that you reconsider how you came to this erroneous conclusion and investigate other possible explanations. This small piece you provided looks correct. Maybe you've simply uncovered a bug in your application and Gatling is just the messenger.
"the documentation on their site is pretty meh"
That's neither nice nor constructive. Maybe explaining what you think is lacking in the documentation? Have you gone through all of it? Have you checked the online courses?
Gatling sessions are isolated so overwritting is not really possible.
I am using saveAs in many simulations without any problems. The issue is somewhere else.

The best way to save game data in Unity that's secure & platfrom independent

I am looking for a way to save the users progress for my game, I am looking for something that can't be tampered with/modified. I would like to have to be able to be platform independent. And I would like it to be stored within the game files to the user can transfer their data to different computers (with a flash drive or something). (Correct me if I'm wrong in any area) But I believe because I need to to be secure and platform independent that removes player prefs from the equation. I know there is a way to save data by encrypting it with Binary, but I don't know how that works and if the user could transfer the data from computer to computer. Is there a better way of saving data? Is encrypting is through Binary the way to go? If so how would I do it? Thank you :) If you have any questions feel free to ask.
Edit: I understand nothing is completely secure, I'm looking for something that can stop the average user from going into a file, changing a float, and having tons and tons of money in game.
The previous answer mentiones two good methods for storing data (although there are still some quirks regarding writing files on different platforms), I'd like to add on to the subject of security, as mentioned in a comment here.
First of all, nothing is fully secure, there is always someone brighter out there that will find a flaw somewhere in your code, maybe unless you want full on crypto, which is not trivial with key management etc.
I understand from the question that he wants to prevent users from moving files between machines, or allow them to move the files between machines but seal them so that users cannot easily change data stored in them.
In either case, a trivial solution would work: generate a hashcode from your dataset, mangle with it a little bit (salt it or do whatever to jump to another hashcode). so you could have something like
{
"name"="john",
"score"="1234",
"protection"="043DA33C"
}
if the 'protection' field is a hashcode of "john1234", it will not match "john9999", hence if the user doesn't know how you salt your protection, you will be able to tell that the save has been tampered with
The first way to save data in unity is use PlayerPrefs, using for example:
PlayerPrefs.SetString("key","value");
PlayerPrefs.SetFloat("key",0.0f);
PlayerPrefs.SetInt("key",0);
PlayerPrefs.Save();
and for get, you only need
PlayerPrefs.GetString("key","default");
The second way and the way that permit you stored in a independent file is use serialization, my prefer way is a use the json file for it.
1) make a class that will store the data (not necessarily it need extends of monobehaviour:
[System.Serializable]
public class DataStorer {
public data1:String = "default value";
public data2:Int = 4;
public data3:bool = true;
....
}
and store it in another class with
DataStorer dataStorer = new DataStorer();
.... // some change in his data
string json = JsonUtility.ToJson(this, true);//true for you can read the file
path = Path.Combine(Application.persistantDataPath, "saved files", "data.json");
File.WriteAllText(path, json);
and for read the data
string json= File.ReadAllText(path);
DataStorer dataStorer = new DataStorer();
JsonUtility.FromJsonOverwrite(json, dataStorer);
and now you dateStorer is loaded with the data in your json file.
I found a link of data encryption tool, which is very helpful according to your need, as you want to secure data on device (nothing 100% secure), there are 3 mode to secure data, APP, Device and Encryption key, you can choose as per your need.
See this link, it may help you.
https://forum.unity.com/threads/data-encryption-tool-on-assets-store.738299/

Reading an SB-Messaging Send Port properties using the Microsoft.BizTalk.ExplorerOM makes a breaking change

I am working on a PowerShell script making use of the Microsoft.BizTalk.ExplorerOM to dynamically update the SB-Messaging SAS key for BizTalk Receive Locations and Send Ports. This is to enable us to roll the SAS keys for our Service Bus queues, and update BizTalk with the new keys as painlessly as possible.
I have this working correctly for Receive Locations, but Send Ports are giving me a different issue.
As soon as I read the PrimaryTransport properties of the Send Port, it seems that some change is made under the covers, that then prevents SaveChanges from working, instead throwing an "Invalid or malformed XML data exception".
This is compared to the the ReceiveLocation, where I can read any of its properties, and then SaveChanges successfully.
Note that in both of this cases, no changes have been made by me. I am simply doing a Read, and then a Save.
Can anyone offer any advice as to what could be causing the issue, and any possible solutions to try?
Had this very same issue, when using Powershell to replace values in ServiceBus ReceiveLocations & SendPorts.
The problem is with the none valid xml symbols in the TransportTypeData, which are converted when the script reads them out in the PS cmd.
All none valid xml symbols (such as the one occuring for Namespace value, ) need to be converted to amp, and if I'm not mistaken even double amp:ed.
Here's an example article showing examples on what I mean by "double amp:ed":
How do I escape ampersands in XML so they are rendered as entities in HTML?
Hope this make sense, and if not, then let me know and I'll give it another go.
Just tried doing this from C#, seems to work ok:
var root = new Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer() { ConnectionString = "Data Source=(local);Initial Catalog=BizTalkMgmtDb;Integrated Security=SSPI;" };
var sendPort = root.SendPorts["xxxx.ServiceBusQueue"];
System.Diagnostics.Trace.TraceInformation(sendPort.PrimaryTransport.TransportTypeData);
sendPort .PrimaryTransport.TransportTypeData = sendPort.PrimaryTransport.TransportTypeData.Replace("RootManageSharedAccessKey", "MySharedAccessKey");
root.SaveChanges();

Dicominfo not giving all metadata

I have a dicom from a GE MRI scanner and there are a few pieces of information in the header I require (namely the relative position of the scan). I tried using info = dicominfo(filename) but, for some reason, this piece of information does not show up. I know that this information is saved, however. It might be a private data, but I'm not completely sure. If anyone has any information on how to resolve this issue that would be greatly appreciated.
Try using the dicomread function instead, it should be more versatile than dicominfo and it reads the information files too. If this doesn't work then it means that the information you are trying to obtain is not made available by GE.
Or use gdcm to dump the private GE header:
$ gdcmdump --pdb input.dcm

How to set the file name of a Word document without saving it from c# and automation II

I have asked here a question on how setting the filename of a Word document via automation without saving it. Thanks to Remou, I have received a nice way doing this via calling the FileSummaryInfo-Dialog and setting the Title-property.
However now I have the problem that the client wants to have document names with special chars in (point and underscore) and it seems to be a bug (or a feature) of word, that it cuts the title and only takes the chars before the first special char for building the file name! I have already googled a lot, however was not able to find a resolution for this problem.
The problem is also noticed here (see under gotcha), however without a solution.
Has anybody another solution for setting the filename without saving, or a workaround/bugfix for the mentioned odd behavior?
Try easyhook, since do not have Windows machine besides my hand these days.
following is just the call flow (something like what i did years ago, changed a software's socket bind port to different one by Detours)
About Hook the CreateFileW:
The example in the easyhook's wiki is just what we want here.
CreateFileHook = LocalHook.Create(
LocalHook.GetProcAddress("kernel32.dll", "CreateFileW"),
new DCreateFile(CreateFile_Hooked),
this);
In the CreateFile_Hooked you can change the parameter InFileName, then call real CreateFileW
static IntPtr CreateFile_Hooked(
String InFileName,
UInt32 InDesiredAccess,
UInt32 InShareMode,
IntPtr InSecurityAttributes,
UInt32 InCreationDisposition,
UInt32 InFlagsAndAttributes,
IntPtr InTemplateFile)
{
// FIGURE OUT THE FILE NAME THAT YOU WANT HERE
// IF the InFileName is not your Document name "My.doc", then call orignal CreateFile
// with all the parameter unchanged.
// call original API...
return CreateFile(
YOUR_CHANGED_FILE_NAME_HERE,
InDesiredAccess,
InShareMode,
InSecurityAttributes,
InCreationDisposition,
InFlagsAndAttributes,
InTemplateFile);
}
Call flow:
After you changed the title to "My_Document_2012_11_29",
then hook the CreateFileW of Word process.
For example when the InFileName is "My.doc",
then you should change it to "My_Document_2012_11_29".
Because this is done in the Word process, so the Detoured function do not know
"My.doc" is mapping to "My_Document_2012_11_29".
There is lot ways to get this mapping info, one is save this mapping info to
a known file in your app, and read the file in the Detoured function.