Skip to content

Commit

Permalink
only export active criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
srietkerk committed Sep 10, 2024
1 parent 6a0d7b5 commit 5031335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions teachertool/src/components/EvalResultDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import { setChecklistName } from "../transforms/setChecklistName";
import { Strings, Ticks } from "../constants";
import { Button } from "react-common/components/controls/Button";
import { runEvaluateAsync } from "../transforms/runEvaluateAsync";
import { isProjectLoaded } from "../state/helpers";
import { showToast } from "../state/actions";
import { makeToast } from "../utils";
import { getSafeChecklistName, getActiveCriteria } from "../state/helpers";
import { isProjectLoaded, getSafeChecklistName, getActiveCriteria } from "../state/helpers";
import { writeChecklistToFile } from "../services/fileSystemService";

interface ResultsHeaderProps {
Expand All @@ -27,6 +26,7 @@ const ResultsHeader: React.FC<ResultsHeaderProps> = ({ printRef }) => {
const { state: teacherTool } = useContext(AppStateContext);
const { checklist, projectMetadata } = teacherTool;
let { name: checklistName } = checklist;
const criteriaToExport = getActiveCriteria(teacherTool);
const [checklistNameInputRef, setChecklistNameInputRef] = useState<HTMLInputElement>();

const handleEvaluateClickedAsync = async () => {
Expand All @@ -49,7 +49,7 @@ const ResultsHeader: React.FC<ResultsHeaderProps> = ({ printRef }) => {

const handleExportChecklistClicked = () => {
pxt.tickEvent(Ticks.ExportChecklist);
writeChecklistToFile(checklist);
writeChecklistToFile({ name: checklistName, criteria: criteriaToExport });
};

return (
Expand Down

0 comments on commit 5031335

Please sign in to comment.