gimly / fluentxapi Goto Github PK
View Code? Open in Web Editor NEWA fluent .Net Standard library to create xApi statements and communicate with a LRS
License: MIT License
A fluent .Net Standard library to create xApi statements and communicate with a LRS
License: MIT License
Tried to install v0.8.0, hoping to be able to step into sources (see #13). But it does not seem to work. Is this a bug, or does the latest release not include the bits from this PR?
The line at https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Verb.cs#L35 throws a NullReferenceException
when the display
parameter is null
.
public Verb(Uri id, ILanguageMap display)
{
if (id == null)
{
throw new ArgumentNullException(nameof(id));
}
Id = id;
if (display != null || display.Any()) // <-- nullref here
{
Display = display;
}
}
Contrary to the other classes, Attachment.cs does not contain yet JsonProperty annotations.
As a consequence the JSON serialization has wrong property names.
It also exports null properties.
E.g. UsageType i.o. usageType. And similar for the other properties.
This leads to parsing errors on an LRS backend.
"attachments": [
{
"UsageType": "http://id.tincanapi.com/attachment/supporting_media",
"Display": {
"en-US": "Test Note"
},
"ContentType": "image/jpg",
"Length": 219730,
"Sha2": "5eddbaa46952f1bd8ac0a09631fa6530ca9077f82e81753702d3cea3ddcdee4b",
"Description": null,
"FileUrl": null
}
]
should be:
"attachments": [
{
"usageType": "http://id.tincanapi.com/attachment/supporting_media",
"display": {
"en-US": "Test Note"
},
"contentType": "image/jpg",
"length": 219730,
"sha2": "5eddbaa46952f1bd8ac0a09631fa6530ca9077f82e81753702d3cea3ddcdee4b"
}
]
cfr https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#example
SCORM Cloud returns a value of ""
on the more
property, if the property is not set. This causes LrsClient.ParseStatementResultAsync
to fail (it only handles a value of null
).
I fixed this by changing line 331 from
if (result["more"] != null )
to
if (result["more"] != null && !string.IsNullOrWhiteSpace(result["more"].Value<string>()))
Minimum
and Maximum
private properties in https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Objects/InteractionActivities/NumericRange.cs are only assigned to, but never used.StringContent
private property in https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Document.cs is never used.Updated
private property in https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Document.cs is only assigned to, but never used.LanguageCode
public readonly property in https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Objects/InteractionActivities/FillInInteractionActivity.cs is never assigned to.The line at https://github.com/MindOnSite/FluentxApi/blob/master/src/Mos.xApi/Score.cs#L51 throws an InvalidOperationException
when the raw
parameter is null
.
if (max.HasValue && raw.Value > max.Value)
{
if (raw.HasValue)
{
throw new ArgumentException("The value for raw must be smaller than or equal to the value of max if max is specified.", nameof(raw));
}
}
Hi,
We noticed that the AddParents method in the ContextBuilder implementation has a bug where the list of parents adds itself instead of adding the 'activities' parameter.
I have created a pull request with a fix for this: #22
Have a nice day
What the title says, is this actively being developed? Do you take PRs when something's missing / broken?
Haven't really tried the library yet, but I want to check this beforehand :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.