-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Teacher Tool: More Telemetry (#10196)
This change adds a few telemetry events and some code changes to support them: 1. Changing the eval result (including a field indicating whether or not it's manual and whether the previous result was manual, which necessitated adding resultIsManual to the result type. I think this could be helpful in the future too, if we decide not to overwrite manual results when doing bulk evaluate) 2. Changing eval notes (debounced) 3. Run single eval (including hash of the checklist which should help with understanding evals / checklist and usage of pre-made checklists) 4. Run bulk eval 5. Importing a checklist (whether there's an invalid file, a successful import, or closed without doing anything) 6. Loading in new projects 7. Block picker opened & block selected 8. Adjusted logging of opening pre-built checklists so we can include checklist hash (and error reporting if a pre-built checklist is invalid) There's also a one-line bug fix so we don't show the "Replace existing checklist" warning when the user clicks new checklist for the first time (only consider having an "existing checklist" if there is criteria, regardless of name).
- Loading branch information
Showing
24 changed files
with
167 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
import { Strings } from "../constants"; | ||
import { Strings, Ticks } from "../constants"; | ||
import { fetchJsonDocAsync } from "../services/backendRequests"; | ||
import { logError } from "../services/loggingService"; | ||
import { verifyChecklistIntegrity } from "../state/helpers"; | ||
import { Checklist } from "../types/checklist"; | ||
import { makeToast } from "../utils"; | ||
import { ErrorCode } from "../types/errorCode"; | ||
import { getChecklistHash, makeToast } from "../utils"; | ||
import { replaceActiveChecklistAsync } from "./replaceActiveChecklistAsync"; | ||
import { showToast } from "./showToast"; | ||
|
||
export async function loadChecklistAsync(checklistUrl: string) { | ||
const json = await fetchJsonDocAsync<Checklist | undefined>(checklistUrl); | ||
const checklist = await fetchJsonDocAsync<Checklist | undefined>(checklistUrl); | ||
|
||
if (!json) { | ||
if (!checklist) { | ||
showToast(makeToast("error", Strings.ErrorLoadingChecklistMsg)); | ||
return; | ||
} | ||
|
||
const { valid } = verifyChecklistIntegrity(json); | ||
const { valid } = verifyChecklistIntegrity(checklist); | ||
|
||
if (!valid) { | ||
logError(ErrorCode.invalidPremadeChecklist, { checklistUrl }); | ||
showToast(makeToast("error", Strings.ErrorLoadingChecklistMsg)); | ||
return; | ||
} else { | ||
pxt.tickEvent(Ticks.LoadChecklistFromUrl, { checklistUrl, checklistHash: getChecklistHash(checklist) }); | ||
} | ||
|
||
await replaceActiveChecklistAsync(json); | ||
await replaceActiveChecklistAsync(checklist); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.