A lab passed with dsoxlab check stays on your machine: the site only sees it
after a sending that you trigger yourself. There are two routes. With an
account, dsoxlab login then dsoxlab push send your attempts to that
account. Without an account, dsoxlab export writes a file that you import in
your browser. This lesson is for anyone who has already passed a lab and wants
to find their score in "My learning". You will see what each route carries, then
which one to choose.
What you will learn
- Say where dsoxlab records a result before any sending.
- Connect your machine to your account with
dsoxlab login. - See what would leave with
dsoxlab push --dry-run, then send it withdsoxlab push. - Write your results to a file with
dsoxlab export. - Import that file into "My learning" without an account.
- Choose between sending to the account and the file.
Prerequisites
- dsoxlab installed and up to date: see Installing dsoxlab locally.
- A lab played and passed with
dsoxlab checkordsoxlab submit: see Getting your work checked with dsoxlab check and submit. - For the account route, an account on the site. It is optional: the file route needs none, as Progress and data explains.
Where are your results recorded before any sending?
Every attempt graded by dsoxlab check or dsoxlab submit is written to the
.dsoxlab.db file of the catalogue, on your machine, and nowhere else. This
file sits at the root of the catalogue you play. Progress is therefore specific
to each catalogue: the same lab played in two copies of the catalogue produces
two separate histories.
check and submit never send anything. A learner who replays a lab ten times
would otherwise produce ten writes to their account, and a sending triggered by
a learning command would make data leave the machine without being asked. So
sending is a separate step, which you type.
When a check or a submit records an attempt in a terminal, dsoxlab may
remind you of the sending commands, with dsoxlab push --dry-run to see first
what would leave. It only does so if the catalogue provides for sending, through
a learning.sync block in its meta.yml. This reminder appears only once on
your machine, all catalogues combined, and it sends nothing.
What does a sending carry, and what does it never carry?
A sending carries attempts, not your progress. Each attempt carries the identifier of the catalogue and of the lab, the date, the score, the verdict, the state of each criterion, the hints taken and, for a mock exam, its verdict. The site then computes for itself what this changes for your trophies and your path.
The document contains nothing about your machine: no path, no host name, no user name. The login token is never written to the catalogue or to the document.
Some attempts never leave, and dsoxlab counts them and names them at the end of the sending, for example:
- those of a lab that is no longer in the catalogue (renamed, moved or removed);
- those of a lab of type
validation, which defends a guide and grades nobody; - those with a field outside what the site accepts.
None of these cases is a failure. The attempts stay in .dsoxlab.db, which the
sending does not modify.
When the sending exceeds the site's size limits, dsoxlab first lightens the
oldest attempts: it sends them without their detail, and says so. The detail
stays in .dsoxlab.db. If the sending is still too big, dsoxlab refuses it
before sending it, or the portal refuses it, and the file of the route without
an account then serves as a fallback.
How do you send your results to your account?
With an account, three commands are enough: dsoxlab login once, then
dsoxlab push whenever you want to send, and dsoxlab logout to forget the
session on this machine. They only work if the catalogue declares where to
send, in a learning.sync block of its meta.yml. A catalogue you wrote
yourself does not declare it until you have added it. The role of each command
is summarised in The main dsoxlab commands.
Signing in with dsoxlab login
dsoxlab login opens the portal's sign-in page in your browser, the portal
being the site's service that holds the accounts. The terminal also prints the
sign-in URL, in case the browser does not open, then waits. You sign in in the
browser: the landing page shows a code, and that code is what the terminal is
waiting for.
dsoxlab loginℹ Open this URL in a browser and sign in. The page you land on shows your code:copy it, and paste it below.https://<portal>/oauth2/authorize?response_type=code&client_id=<identifier>&redirect_uri=…&scope=…&state=…&code_challenge=…&code_challenge_method=S256Paste the address the browser ends up on, read from its address bar (or just the code):✔ Signed in to https://<portal>.ℹ The session is kept under XDG_STATE_HOME, readable by you only, and never in the catalog. dsoxlab logout forgets it.The URL is shortened here: yours is longer. At the "Paste the address…" prompt,
paste the code that the landing page shows. The terminal also accepts the
whole address where the browser ended up, read from its address bar. Copy one or
the other in full: a truncated address, or one rewritten by the terminal when
pasting, makes the sign-in fail. Run dsoxlab login again in that case. Nothing
is sent as long as you have pasted nothing.
Then look for the line that starts with ✔ Signed in to: it names the portal
you are signed in to (shortened here). Check that it is the portal of the site
you use, because the catalogue chooses which site the sign-in goes to.
Without this line, push will answer that it has no session. The second line
mentions XDG_STATE_HOME, a variable from the XDG specification that names the
folder where a program keeps its state data. By default, dsoxlab keeps the
session there, in ~/.local/state/dsoxlab/sessions/: one file per portal,
readable by you alone, and never in the catalogue.
On a machine without a browser, for example a server reached over SSH, add
--no-browser. The output is the same, but dsoxlab does not try to open the
browser: you open the URL on another machine, then paste the code or the landing
address into this terminal.
dsoxlab login --no-browserSeeing what would leave with push --dry-run
dsoxlab push --dry-run counts the attempts that would leave and stops there.
Nothing leaves your machine, and no session is required: you can run it even
before having played login.
dsoxlab push --dry-runℹ 2 attempt(s) would be sent. Nothing has left this machine.Read the announced number of attempts, then the warnings that may follow. Each
warning names a reason for a gap and the number of attempts concerned: these are
the ones that will never appear on the account. The command needs the catalogue
to declare learning.sync, like push does: if it does not, the command says
so, which is the quickest way to know whether your catalogue can send.
Sending with dsoxlab push
dsoxlab push first reads what the account already holds, adds what is missing,
then writes the result. It is a merge, never an overwrite: the account may
contain attempts played on another machine, and they stay.
dsoxlab push✔ 2 attempt(s) added. The account now holds 2, at revision 22.The output says how many attempts were added and how many the account now holds. If an attempt was already on the account, it is left as it is, and the output says so.
Running dsoxlab push again without a new attempt is safe. dsoxlab notes that
the account already holds exactly the same attempts, writes nothing and says so.
✔ The account already held exactly these 2 attempt(s): nothing written, revision 22 unchanged.ℹ 2 attempt(s) were already on the account, and were left as they are.The revision is the version number of the "lab results" part of your account. It goes up at every write, wherever the write comes from, and stays the same when nothing is written. It does not count your attempts: the 22 in these examples depends on the account's history, yours will be different.
The diagram follows a complete sending, from login to the write. Look at two
things: the learning.sync declaration is read before any call to the portal,
and dsoxlab reads the account's attempts before writing to it, which is what
makes the merge possible.
Three terms in the diagram come from the OAuth sign-in, and you have nothing to configure. "Authorization Code" is the method where the portal first returns a code, which dsoxlab then exchanges for a session. PKCE protects that exchange: dsoxlab keeps a single-use secret, the verifier, and only shows it to the portal at the end. As for the session "bound to api, domain, client", it is only valid for the portal that issued it, which explains the "session from another portal" message in the troubleshooting section.
Finding your results on the site
The sending fills your account, not a browser directly. A browser linked to the same account syncs when you open "My learning" (at most once a minute and per tab), or when you click "Sync now" in the "Account" block of the "My data" tab. Your attempts then arrive on the "DSOXLab results" row of that tab, which shows the number of results ("1 lab result" or "3 lab results"), the number of practices and proofs passed, and the date of the last import. They also count in "My path" and in the trophies. The detail of what the site does with this data is in Progress and data.
Forgetting the session with dsoxlab logout
dsoxlab logout deletes the session file of this machine. It does not revoke
the token on the site's side: for that, sign out of the site in your browser.
On a shared machine, do both.
dsoxlab logout✔ Local session for https://<portal> forgotten.ℹ This only erases the local file. To revoke the token itself, sign out from the portal in your browser.A dsoxlab push run afterwards answers ✘ No session for this portal: dsoxlab login opens one. and returns code 1. With no session open on this machine,
logout says so and deletes nothing:
dsoxlab logoutℹ No local session for this portal: nothing to do.ℹ This only erases the local file. To revoke the token itself, sign out from the portal in your browser.How do you send your results without an account?
Without an account, dsoxlab export writes your results to a JSON file, and
you import that file into "My learning". No sign-in, no network, and no
learning.sync block in the catalogue: the file route works on every
catalogue.
Writing the file with dsoxlab export
Without an option, dsoxlab export writes the document to standard output,
that is, to the terminal. To get a file, give it a name with -o. With
--lab <identifier>, the file only contains the last attempt of that lab;
without this option, it contains the whole history of the catalogue. The file is
JSON: its count field gives the number of results, and the results list
contains them. Your numbers depend on your catalogue and on what you played in
it.
dsoxlab export -o history.jsonℹ 3 result(s) written to history.jsonThe confirmation gives the number of results written and the path of the file. dsoxlab never overwrites an existing file unless you ask for it with an option, which its error message names: a proof replaced in silence is a proof lost. It also refuses to write through a symbolic link.
Importing the file into My learning
Open "My learning" on the site, "My data" tab. The "DSOXLab results" row has the "Import DSOXLab results" button. Choose the file: the browser reads it in place, without sending it anywhere, then opens a confirmation screen. It is titled "DSOXLab result detected" and says, for a single result, the catalogue, the lab, its type, the number of passed checks with the verdict, and the date. Nothing is added until you click "Add to my learning"; "Ignore" keeps nothing. If the file was already imported, the screen states that these results will not be added twice.
This route has a limit to know about: without an account linked to this browser, the import only fills the browser where you do it. Another browser, or another device, will see nothing until you import the same file there.
The file can travel from one machine to another like any file: that is what helps when the machine that plays the labs cannot reach the site.
Exercise: reading an export, a dry-run sending and an import
This exercise produces a results file, reads what a dry-run sending announces,
then shows the file to the site. It assumes a passed lab. Steps 1, 2 and 4 work
on every catalogue; step 3 needs a catalogue that declares learning.sync, but
neither an account nor a session. The numbers in step 3 come from your
catalogue and are not those of the lesson's examples.
Reading an export, a dry-run sending and an import
You have passed a lab, and you want to see what a sending would contain, then what the site does with your file. The first three steps are played in the lab's catalogue.
Write a lab's last attempt
Write to proof.json the last attempt of the lab you have just passed, then open the file and find the validated field.
Run the write again on the same file
Run the same command again without changing anything. Read the error message: it says what to add to replace the file.
Do a dry-run sending
Run the sending in trial mode, read the announced number of attempts and the sentence that says what has left the machine.
Import the file into My learning
In "My learning", "My data" tab, import proof.json on the "DSOXLab results" row. Read the Result line of the confirmation screen, then click "Ignore" if you do not want to keep this result.
- dsoxlab export
- dsoxlab push
- My learning
A hint 1 / 2
dsoxlab export limits the file to one lab with an option that takes the lab's identifier, and writes to a file with another one.
A hint 2 / 2
The trial mode of push is an option of the command, not a separate command.
I have tried: show the solution
First step: dsoxlab export --lab <identifier> -o proof.json. The file contains a single row in results, the last attempt of the lab, and its validated field is true since you have just passed the lab.
ℹ 1 result(s) written to proof.jsonSecond step: without --force, dsoxlab refuses to overwrite the file and names the option. With --force, the file is replaced.
$ dsoxlab export --lab <identifier> -o proof.json✘ proof.json already exists.ℹ A proof replaced in silence is a proof lost. Pass --force to overwrite it, or choose another name.$ dsoxlab export --lab <identifier> -o proof.json --forceℹ 1 result(s) written to proof.jsonThird step: dsoxlab push --dry-run announces how many attempts would leave and states that nothing has left the machine. The announced number is that of the attempts recorded in your catalogue: each check and each submit adds one, so yours may differ from the example.
ℹ 2 attempt(s) would be sent. Nothing has left this machine.Fourth step: the confirmation screen opens under the title "DSOXLab result detected". Its Result line gives the number of passed checks followed by the verdict: "Passed via DSOXLab" for a passed lab, so the answer is "passed". "Ignore" closes the screen without recording anything; "Add to my learning" records the result in this browser.
Account or file: which one to choose?
Choose the account if you play labs often from a machine that can reach the site, the file in the other cases. Both routes bring your attempts to the site; they differ in what they require and in where the result arrives.
| Your situation | Recommended route | Why |
|---|---|---|
| You play regularly and want to avoid the file | Account: login then push | One more step after check, no file to move |
| You work on several machines | Account | push merges the attempts of each machine into the same account |
| You do not want an account | File: export | Nothing leaves your browser or your machine |
| The machine running the labs cannot reach the site (closed network, server) | File | The file can be copied by any means |
| Machine without a browser | File, or account with login --no-browser | Both work; the sign-in ends on another machine |
The two routes can be combined: an imported file does not prevent a sending to the account afterwards.
Troubleshooting
dsoxlab's error messages name the cause and say what to do; this table
covers the cases of this lesson. None of them loses your results: they stay
in .dsoxlab.db.
| Symptom | Cause | Solution |
|---|---|---|
push or login says the catalogue declares no synchronization | The catalogue's meta.yml has no learning.sync block | Use dsoxlab export and the file import, or ask the catalogue's author to add the block |
push says there is no session for this portal | dsoxlab login has not been played on this machine | dsoxlab login, then dsoxlab push |
push says the session has expired and could not be renewed | The local session is out of date | Play dsoxlab login again |
push says the session comes from a different portal | This catalogue declares a different portal from the one of the saved session | The catalogue chooses which portal the sign-in goes to: only sign in again if you trust this catalogue, otherwise you would hand a session to another site |
| The announced number of attempts is 0, or smaller than expected | No attempt recorded in this catalogue, or attempts dropped (lab gone, validation lab) | Check the current catalogue, read the warnings, play dsoxlab check again |
login fails after the paste | The pasted address or code is truncated or rewritten on pasting | Copy it in full from the landing page or the address bar, then run login again |
| The portal does not answer | Network down or site unavailable | Play dsoxlab push again when the site answers: nothing was written, so the sending can be replayed safely |
export -o refuses to write | The file already exists, or it is a symbolic link | If the file exists, add --force. If it is a symbolic link, choose another file name, because --force does not get around it |
A sending refused because it is still too big, even lightened, is worked around
with the file route: dsoxlab export -o proof.json.
Key points
dsoxlab checkanddsoxlab submitrecord to the catalogue's.dsoxlab.dband never send anything; a sending carries attempts, with no path, host name or user name.- With an account:
dsoxlab loginonce (paste the code from the landing page, with--no-browserif the machine has no browser),dsoxlab push --dry-runto look,dsoxlab pushto send,dsoxlab logoutto forget the session. - These commands need a
learning.syncblock in the catalogue'smeta.yml;push --dry-runsays whether yours declares one. pushmerges with what the account already holds and writes nothing when everything is already there.- Without an account:
dsoxlab export -o file.json, then "Import DSOXLab results" in "My data", with the "Add to my learning" confirmation screen. - Without a linked account, the import only fills the browser where it is done; sending to the account feeds every linked browser.
Knowledge check
Check that you have the essentials of this guide. The questions only cover what has just been explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Starting over or cleaning up a dsoxlab lab: reset, clean, destroy
A new full quiz with random questions
Work again only on the questions you missed