Hidden the level score when not released
This commit is contained in:
@@ -25,14 +25,16 @@ import useExams from "@/hooks/useExams";
|
||||
interface Props {
|
||||
isCreating: boolean;
|
||||
users: User[];
|
||||
user: User;
|
||||
groups: Group[];
|
||||
assignment?: Assignment;
|
||||
cancelCreation: () => void;
|
||||
}
|
||||
|
||||
export default function AssignmentCreator({isCreating, assignment, groups, users, cancelCreation}: Props) {
|
||||
export default function AssignmentCreator({isCreating, assignment, user, groups, users, cancelCreation}: Props) {
|
||||
const [selectedModules, setSelectedModules] = useState<Module[]>(assignment?.exams.map((e) => e.module) || []);
|
||||
const [assignees, setAssignees] = useState<string[]>(assignment?.assignees || []);
|
||||
const [teachers, setTeachers] = useState<string[]>(!!assignment ? assignment.teachers || [] : [...(user.type === "teacher" ? [user.id] : [])]);
|
||||
const [name, setName] = useState(
|
||||
assignment?.name ||
|
||||
generate({
|
||||
@@ -84,6 +86,7 @@ export default function AssignmentCreator({isCreating, assignment, groups, users
|
||||
endDate,
|
||||
selectedModules,
|
||||
generateMultiple,
|
||||
teachers,
|
||||
variant,
|
||||
instructorGender,
|
||||
released,
|
||||
|
||||
@@ -524,6 +524,7 @@ export default function CorporateDashboard({user, linkedCorporate}: Props) {
|
||||
{router.asPath === "/#assignments" && (
|
||||
<AssignmentsPage
|
||||
assignments={assignments}
|
||||
user={user}
|
||||
groups={assignmentsGroups}
|
||||
users={assignmentsUsers}
|
||||
reloadAssignments={reloadAssignments}
|
||||
|
||||
@@ -713,6 +713,7 @@ export default function MasterCorporateDashboard({user}: Props) {
|
||||
assignments={assignments}
|
||||
corporateAssignments={corporateAssignments}
|
||||
groups={assignmentsGroups}
|
||||
user={user}
|
||||
users={assignmentsUsers}
|
||||
reloadAssignments={reloadAssignments}
|
||||
isLoading={isAssignmentsLoading}
|
||||
|
||||
@@ -301,6 +301,7 @@ export default function TeacherDashboard({user, linkedCorporate}: Props) {
|
||||
assignments={assignments}
|
||||
groups={assignmentsGroups}
|
||||
users={assignmentsUsers}
|
||||
user={user}
|
||||
reloadAssignments={reloadAssignments}
|
||||
isLoading={isAssignmentsLoading}
|
||||
onBack={() => router.push("/")}
|
||||
|
||||
@@ -16,11 +16,12 @@ interface Props {
|
||||
groups: Group[];
|
||||
users: User[];
|
||||
isLoading: boolean;
|
||||
user: User;
|
||||
onBack: () => void;
|
||||
reloadAssignments: () => void;
|
||||
}
|
||||
|
||||
export default function AssignmentsPage({assignments, corporateAssignments, groups, users, isLoading, onBack, reloadAssignments}: Props) {
|
||||
export default function AssignmentsPage({assignments, corporateAssignments, user, groups, users, isLoading, onBack, reloadAssignments}: Props) {
|
||||
const [selectedAssignment, setSelectedAssignment] = useState<Assignment>();
|
||||
const [isCreatingAssignment, setIsCreatingAssignment] = useState(false);
|
||||
|
||||
@@ -39,6 +40,7 @@ export default function AssignmentsPage({assignments, corporateAssignments, grou
|
||||
assignment={selectedAssignment}
|
||||
groups={groups}
|
||||
users={users}
|
||||
user={user}
|
||||
isCreating={isCreatingAssignment}
|
||||
cancelCreation={() => {
|
||||
setIsCreatingAssignment(false);
|
||||
|
||||
Reference in New Issue
Block a user