"Veileder For Kvalitet i Læremidler" Veileder For Kvalitet i Læremidler er en tjenste laget av UDIR basert på altinn.studio/altinn 3.0 referansesystem. Selve tjenesten kan du finne:https://www.udir.no/kvalitet-og-kompetanse/laremidler/kvalitetskriterier-for-laremidler/
Dette er Udir sin tjeneste for vurdering av kvalitet i læremidler. Her kan du som er skoleleder eller skoleeier invitere lærere til å gjøre en vurdering. Du blir bedt om å velge hvilket læremiddel som skal vurderes, hvilken læreplan det skal vurderes for og hvem du ønsker å invitere til å gjøre vurderingen. Etter at de inviterte lærerne har gjennomført vurdering, får du se resultatene i en samlevisning som kan brukes for drøfting og valg av læremiddel.
En hjelpeside for veilederen kan finnes her: https://www.udir.no/kvalitet-og-kompetanse/laremidler/kvalitetskriterier-for-laremidler/veiledere-for-kvalitet-i-laremidler/#a163161
VFKL core system is built to receive data from altinn3.0. We will consume the events produced by Altinn 3.0 for the application to fetch the data. To generate events for our app, we must first activate the event generation.How to activate generation of events in our application can be found here
Core system will react to events pushed by altinn 3.0 and fetch data from altinn platformen.
Following instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Git clone https://github.com/Utdanningsdirektoratet/VFKL.git
-
.Net 6.0
-
For local development : Postgres on docker (It is also possible to install postgres directly)
- Install docker desktop from here https://docs.docker.com/desktop/windows/install/
- Run <<docker run -d -p 5432:5432 --name vfkl POSTGRES_PASSWORD=Test1234 vfkladmin>> to get the postgres database for vfkl up and running in the local development environment
-
Azure function core tools v4
- Install azure function core tools from here https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash
-
pgAdmin - Tool to manage the postgres database
- Install pgAdmin from here https://www.pgadmin.org/download/
-
Microsoft recommends that we use Azurite for local Azure storage development. Azurite is a storage emulator. Azurite is automatically avaialable with Visualstudio 2022. If not, Azurite can be downloaded from
https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio
-
Azure Storage Explorer - This is used to view the local blob container, queue. It can also be used to manage the resources in azure.
- It can be installed from here https://azure.microsoft.com/en-us/features/storage-explorer/#overview
-
Postman - This is used to test the api
- You can either use postman web or use postman desktop
-
A code editor - Visual studio/Visual studio code
-
Open pgAdmin
-
Click on create-->server. You will see the following screen
-
Give a name f.ex vfkl-local
-
Click on connection and enter the following
- Hostname/address : localhost
- Port : 5432 (it is usually prefilled)
- Maintenance database:postgres
- Username : vfkladmin
-
Click save
-
Now you can see that your local server is listed under Servers
-
Click on vfkl-local--->Databases
-
Now you can see the system database postgres.
-
To setup the database for the first time, create a database by running the following sql script
CREATE DATABASE Vfkl;
The sql script can be run by opening the query tool window. To open the query tool window, right click on the postgres database and select query tool.
-
Run the cleandbdeploy.sql script that is found in deployment folder. This script will create the required schemas, tables and stored procedures
Local storage can also be managed using Azure storage explorer tool.
- Open the Azure storage explorer. You will see an explorer in the left. Expand "Local & Attached", then Emulator
- Now you can see Blob containers, queues, tables if your emulator is running
- Right click on the blob container and create a blob container "inbound"
We need to setup a local settings file that will contain all the environment variable, settings needed to run the application locally. Add a new file called lcoal.settings.json
{
"IsEncrypted": false,
"Values": {
"ASPNETCORE_ENVIRONMENT": "Development",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"QueueStorageSettings:ConnectionString": "UseDevelopmentStorage=true",
"VFKLCoreSettings:AccountKey":"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
"VFKLCoreSettings:AccountName": "devstoreaccount1",
"VFKLCoreSettings:BlobEndpoint": "http://127.0.0.1:10000/devstoreaccount1",
"VFKLCoreSettings:MaskinportenBaseAddress": "",
"VFKLCoreSettings:MaskinportenAudience": "",
"VFKLCoreSettings:AltinnMaskinportenApiEndpoint": "",
"VFKLCoreSettings:MaskinPortenClientId": "",
"VFKLCoreSettings:PlatformBaseUrl": "",
"VFKLCoreSettings:AppsBaseUrl": "",
"KeyVault:KeyVaultURI": "",
"KeyVault:MaskinportenKey": "",
"VFKLCoreSettings:DatabaseConnectionString": "Server=localhost;Database=vfkldb;Port=5432;User Id=postgres;Password=Test1234;",
"AzureWebJobsSecretStorageType": "Files"
}
}
The Blobendpoint, accountname, accountkey are configured with local storage emulator connections. By default, they are configured with the above values. The MaskinPortenClientId is the client id that you can get from the samarbeidsportalen where you register a maskinporten client. The maskinportenkey is the publicprivate key pair that you receive from the samarbeidsportal which is then base64 encoded and and set in here.
The application can be run locally either
- by pressing F5 from visual studio or
- Navigate to src/vfklcore and then Run <>
The main trigger for the function is a http trigger and can be triggered by sending an api request to the EventsReceiver funtion.
-
Trigger the EventsReceiver function
-
Add the following in the request body
{ "source": "https://udir.apps.tt02.altinn.no/udir/vfkl/instances/52043226/04e49a21-b2d5-4233-a6dc-9710b7678d3f", "subject": "party/52043226", "type": "app.instance.process.completed", "time": "2022-05-03T09:06:50.3736712Z", "id": "91f2388f-bd8c-4647-8684-fd9f68af5b14" }
Replace the <<52043226/04e49a21-b2d5-4233-a6dc-9710b7678d3f>> with your partyid/instanceid for testing
- Run http://localhost:7071/api/EventsReceiver as a POST request
- This will trigger the EventsReceiver function. The Events receiver will queue the event to the EvetsProcessor.
- The EventsProcessor will process the event in the queue and save the formdata, attachment data and instance data in the blob storage and in the database
-
-
Api to get the invitation information is also hosted as a function. Api request to get the invitation information can be triggered by
http://localhost:7071/api/assessment/lOQeEJST4kKrRQsolWqBew
This will return the group invitation information.
Once the function is run, the received data can be verified by checking the local blob containers and the database.
- Open the Azure storage explorer. You will see an explorer in the left. Expand "Local & Attached", then Emulator
- Now you can see Blob containers, queues, tables if your emulator is running
- Click on Blob containers. A list of blob containers can be seen. When you click on inbound container, you can see folders on the right pane. Each folder represents an app in the Altinn3
- Click on one of the app to explore the data.
- You will see folders with guid as folder name. Each folder represent an instance that was sent in by user
You can use pgadmin tool to connect to the local database and query the data to verify.