Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 179 additions & 118 deletions bases/rsptx/admin_server_api/routers/instructor.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from "@store/dataset/dataset.logic.api";
import { useGetAvailableReadingsQuery } from "@store/readings/readings.logic.api";
import sortBy from "lodash/sortBy";
import { useCallback, useEffect } from "react";
import { useCallback, useEffect, useState } from "react";
import { useDispatch } from "react-redux";

import { useSelectedAssignment } from "@/hooks/useSelectedAssignment";
Expand All @@ -25,6 +25,7 @@ import { Assignment, CreateAssignmentPayload } from "@/types/assignment";
import { saveEnforceDue, saveVisibility } from "./assignmentMutationHandlers";
import { ErrorState } from "./components/ErrorState/ErrorState";
import { AssignmentEdit } from "./components/edit/AssignmentEdit";
import { ImportAssignmentModal } from "./components/importAssignment/ImportAssignmentModal";
import { AssignmentList } from "./components/list/AssignmentList";
import { AssignmentWizard } from "./components/wizard/AssignmentWizard";
import { defaultAssignment } from "./defaultAssignment";
Expand All @@ -37,6 +38,7 @@ import styles from "./AssignmentBuilder.module.css";

export const AssignmentBuilder = () => {
const dispatch = useDispatch();
const [importModalVisible, setImportModalVisible] = useState(false);
const { isLoading, isError, data: assignments = [] } = useGetAssignmentsQuery();
const [createAssignment, { isLoading: isCreating }] = useCreateAssignmentMutation();
const [updateAssignment] = useUpdateAssignmentMutation();
Expand Down Expand Up @@ -193,10 +195,15 @@ export const AssignmentBuilder = () => {
onEdit={handleEdit}
onDuplicate={handleDuplicate}
onEnforceDueChange={handleEnforceDueChange}
onImport={() => setImportModalVisible(true)}
onVisibilityChange={handleVisibilityChange}
onRemove={onRemove}
/>
)}
<ImportAssignmentModal
visible={importModalVisible}
onHide={() => setImportModalVisible(false)}
/>
{mode === "create" && (
<AssignmentWizard
control={control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,4 @@ describe("getVisibilityToastCopy", () => {
).toBe("Assignment visibility is scheduled");
});
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.search {
flex: 1;
min-width: 16rem;
}

.nameButton {
background: none;
border: none;
padding: 0;
font: inherit;
font-weight: var(--rs-font-weight-medium);
color: var(--rs-text-strong);
text-align: left;
cursor: pointer;
transition: color var(--rs-transition-fast);
}

.nameButton:hover {
color: var(--rs-brand-600);
}

.questionList {
max-height: 22rem;
overflow-y: auto;
border: 1px solid var(--mantine-color-default-border);
border-radius: var(--mantine-radius-sm);
}

.questionRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.5rem 0.75rem;
}

.questionRow + .questionRow {
border-top: 1px solid var(--mantine-color-default-border);
}

/* A reading that stays behind on a cross-book import. Struck through rather
than hidden: the row is what tells the instructor it is being left out. */
.skippedName {
text-decoration: line-through;
}
Loading
Loading