Mapping from Run-Time Environment Data Model to Tracking Model - scorm

Activity 1
Activity 2
Activity 3
Suppose that the Current Activity is Activity 1. Activity 1 has a primary objective. Activity 1 sets cmi.objectives.0.success_status = passed and it never sets cmi.success_status. In this case, after mapping data from Run-Time Environment data model to Tracking Model the ObjectiveProgressStatus and ObjectiveSatisfiedStatus of the primary objective of the Activity 1 are set to False. In fact, after mapping, cmi.success_status is overwritten on cmi.objectives.0.success_status. Is this correct?

No, not correct. The primary objective cannot be directly accessed at runtime. To set its tracking data at runtime, you have to use "cmi.success_status" or "cmi.score.scaled". One more thing, tracking data of local obectives other than the primary objective are handled by the SCO only and the role of the LMS is just to keep track of their status without taking any action based on their tracking data. The primary objective is the core of the activity and it holds its tracking data.

Related

Symfony axios pass only id or entire object?

I have a Booking entity which has a ManyToOne relationship with my Car entity. I use axios to post my data for creating a Booking. I'm not sure if it's better practice to pass my whole Car object to my create function inside my Controller or to only pass the Car's id to the route of the function (which then fetches the Car from my database thanks to Symfonys param converter). Or is there another way which is considered "best practice"?
It depends on your scenario and the way you want to use.
Whenever you have to create an object / row inside the database then you will have to pass the whole object. assuming that the cars has already been created inside the database and you only have to link the booking object with the car than i will prefer you to bind it using ids rather than placing the whole object.
If you place the whole car object than it will increase the retrieval performance but if someday the information of car is changed than you will have to change the information on every booking object in which you placed the car object but if you just bind it with the Car Id than it will always give user the latest information even if the info of Car has been changed.
I thought that it will reduce the performance of the application if we used Id but that is not the case the DBMS use indexing to manage the search and search through id takes not time. It performance is not an issue and yes if you pass a whole object than it will also consume more data (since a large amount of data will be uploaded).

Unable to remove participant from further transaction on same asset

Parties in the business. .
Parties A , B , C
Asset : Order
Party A sends first transaction for both parties B and C
Party B sends next transaction to A and C (on same order , we used vault query to get input state)
Now we want Party C should not receive any future transaction on this Order. When we remove C from participant list we get following error. Looks like Corda is taking participant list from input state. Please suggest a solution to the problem.
java.lang.IllegalArgumentException: Flow sessions were not provided for the following transaction participants: [O=C, L=NV, C=US]
This error message comes from the FinalityFlow:
https://github.com/corda/corda/blob/56067acd208b1b58f17cca85c0eb40ad0e9a1ff5/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt#L159-L161
To explain why you got that error, let's go back to the definition of participants:
https://github.com/corda/corda/blob/56067acd208b1b58f17cca85c0eb40ad0e9a1ff5/core/src/main/kotlin/net/corda/core/contracts/ContractState.kt#L19
A participant is any party that should be notified when the state is created or consumed.
Following that statement, when your transaction has one (or more) inputs and one (or more) outputs, then this transaction should be recorded (i.e. finalized) in the union of all participants of all input and output states, because again; following the participants definition, they should be notified when their states are created or consumed.
That's why, finality flow expects a FlowSession for each participant in the transaction, and throws the error that you saw when it finds a missing one.
Now, regarding privacy concerns (the other part of your question); even though FinalityFlow records the finalized transaction in the union of all participants; it doesn't record all outputs states in all vaults, it has a parameter called StatesToRecord which defaults to ONLY_RELEVANT:
https://github.com/corda/corda/blob/56067acd208b1b58f17cca85c0eb40ad0e9a1ff5/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt#L47
Which means, a node will only register the states that it participates in.
So to summarize, the transaction will be recorded in the union of all participants (of all input/output states), but each participant will only register in their vault the relevant output states.
Important: The peer node that calls ReceiveFinalityFlow might override the default value of statesToRecord and choose ALL_VISIBLE which means record all output states of the transaction whether it's a participant or not:
https://github.com/corda/corda/blob/56067acd208b1b58f17cca85c0eb40ad0e9a1ff5/core/src/main/kotlin/net/corda/core/flows/FinalityFlow.kt#L272-L274
I suggest you read my article on privacy analysis using CDL here; it's more detailed about this topic: https://blog.b9lab.com/how-to-design-a-cordapp-and-analyze-privacy-leaks-using-cdl-views-da825953ff54

Defining Google Tag Manager Data Layer variables

I have a question about Google Tag Manager (GTM) and Data Layer:
Let's assume that the analytics team asks developers to push an event in Data Layer called "test" which has the following structure:
{
product_id : '1234',
category: 'toys'
}
Let's assume I have a tag that needs to send those variables to a third party provider.
According to my understanding of the GTM workflow I have to create two separate data Layer variables, one for product_id and one for category.
This is quite a manual/long/error prone process for events with a lot of variables, and I also worry that there could be confusion if another variable is called ‘category’ from another event.
So my question is:
Can I define in GTM the 'parent' level variable called 'test' (the name of the event itself), and then create test.product_id and test.category variables?
Thanks
Proper data governance should dictate that your data layer keys are well defined so that you don't have redundancy and ambiguity. Also, use of the event key is vital if you absolutely need to reuse a particular name, like category, with a different event. In that example, your data layer variable can be used for whatever event, and the event itself will ensure that that key is getting the correct value into the correct event tag.
If you do need to use a nested data structure, make sure your data layer variable uses the proper dot notation as you've indicated (ie. test.0.category). Note that in much the same way, the enhanced ecommerce data layer parameters can accessed.

How to store only node specific off-ledger custom data in corda?

I created custom table in corda using QueryableState. e.g. IOUStates table.
I can able to see the custom information getting stored in this kind of table.
but i observed that if party A and Party B is doing the transaction then this
custom information gets stored at both the places , e.g. IOUStates
table getting created at nodeA ledger as well as nodeB's ledger.
and custom information is stored in partyA's and PartyB's ledger.
My Question is :-
If some Transaction is getting processed from PartyA's node , then
I want to store part of the transaction's data i.e. custom data ONLY at partyA's Ledger.* level . i.e. off-Ledger of partA only.
It should not be shared with partyB.
In simple case , how to store Only node specific off ledger custom data ?
Awaiting for some reply...
Thanks.
There's a number of ways to achieve this:
Don't use Corda at all! If the data is truly off-ledger then why are you using Corda? Instead, store it in a separate database. Of course you can "JOIN" it with on-ledger data if required, as the on-ledger data is stored in a SQL database.
Similar to point one except you can use the jdbcSession() functionality of the ServiceHub to create a custom table in the node's database. This table can easily be accessed from within your flows.
Create a ContractState object that only has one participant: the node that wants to store the data. I call this a "unilateral" state, i.e. a state that only one party ever stores.
Most importantly, if you don't want to share some data with a counter-party then it should never be disclosed inside a corda state object or attachment that another party might see. Instead:
inside your flows, you can use the data encapsulated within the shared state object (e.g. the IOU) to derive the private data
alternatively if the data is supplied when the flow begins then store the private data locally using one of the methods above

Filtering with multiple flags in a view

I'm building a Drupal site that has a database of local services. I'm using 2 vocabularies to categorise the services by:
a. Ward/Neighbourhood
b. Type of Service
Using the Views, Flag and Flag Terms modules, I'm trying to set up an interface that allows users to filter the records in 3 stages:
Flag the local wards/neighbourhoods they want to find services in.
Flag the types of service they are interested in
View a list of services filtered on the flagged terms set in steps 1 and 2. The list should only show services of the type selected in step 2 and only within the wards selected in Step 1.
Each of these stages is set up as a view. The first 2 views are working fine; users are able to Flag the terms for ward and service type.
The problem is the 3rd view which filters nodes based on the Flags. In the View, I've added Flag relationships for each vocabulary. But when I try to filter the nodes on Flag 1 AND Flag 2, no records are returned.
It seems like Flag 1 needs to be an argument for the second filter, but I'm not sure how to pass the flag IDs in to the URL.
I'm struggling with the logic of this, any help would be much appreciated.
I've solved it by creating a custom module, as explained here:
http://sethsandler.com/code/drupal-6-creating-activity-stream-views-custom-sql-query-merging-multiple-views-part-1/

Resources