Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/course/commands.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { defineMessage } from "react-intl";67import type { CourseEditorActions } from "@cocalc/frontend/frame-editors/course-editor/actions";8import { course, IntlMessage, labels } from "@cocalc/frontend/i18n";9import { ENV_VARS_ICON } from "@cocalc/frontend/project/settings/environment";1011// ATTN: the COMMANDS configuration is not only used in the menu (using ManageCommands),12// but also directly in some dialogs. Hence this is a subset from the Command type.13type Command = {14title: string | IntlMessage;15label: string | IntlMessage;16onClick: (arg: { props: { actions: CourseEditorActions } }) => void;17icon: string;18button: string | IntlMessage;19};2021export const COMMANDS: { [name: string]: Command } = {22"add-students": {23icon: "users",24label: course.add_students,25button: defineMessage({26id: "course.commands.add-students.button",27defaultMessage: "+Student",28description:29"Adding Students in a course. A short label on a button, starting with a + sign.",30}),31title: course.add_students_tooltip,32onClick: ({ props }) => {33const { actions } = props;34actions.setModal("add-students");35},36},37"add-assignments": {38icon: "share-square",39label: course.add_assignments,40button: defineMessage({41id: "course.commands.add-assignments.button",42defaultMessage: "+Assignment",43description:44"Adding an assignment in a course. A short label on a button, starting with a + sign.",45}),46title: defineMessage({47id: "course.commands.add-assignments.tooltip",48defaultMessage: "Add one or more assignments to this course.",49}),50onClick: ({ props }) => {51const { actions } = props;52actions.setModal("add-assignments");53},54},55"add-handouts": {56icon: "text1",57label: defineMessage({58id: "course.commands.add-handouts.label",59defaultMessage: "Add Handouts",60description: "Adding a handout in a course.",61}),62button: defineMessage({63id: "course.commands.add-handouts.button",64defaultMessage: "+Handouts",65description:66"Adding a handout in a course. A short label on a button, starting with a + sign.",67}),68title: defineMessage({69id: "course.commands.add-handouts.tooltip",70defaultMessage: "Add one or more handouts to this course.",71}),72onClick: ({ props }) => {73const { actions } = props;74actions.setModal("add-handouts");75},76},77"title-and-description": {78icon: "header",79label: course.title_and_description_label,80button: labels.title,81title: defineMessage({82id: "course.commands.title-and-description.tooltip",83defaultMessage: "Set the course title and description.",84description: "title and description of a course for students.",85}),86onClick: ({ props }) => {87const { actions } = props;88actions.setModal("title-and-description");89},90},91"email-invitation": {92icon: "mail",93label: course.email_invitation_label,94button: labels.invite,95title: defineMessage({96id: "course.commands.email-invitation.tooltip",97defaultMessage:98"If you add a student to this course using their email address, and they do not have a CoCalc account, then they will receive this email invitation.",99}),100onClick: ({ props }) => {101const { actions } = props;102actions.setModal("email-invitation");103},104},105"copy-limit": {106icon: "users",107label: defineMessage({108id: "course.commands.copy-limit.label",109defaultMessage: "Parallel Copy Limit",110}),111button: labels.limit,112title: defineMessage({113id: "course.commands.copy-limit.tooltip",114defaultMessage:115"Max number of students to copy and collect files from in parallel.",116}),117onClick: ({ props }) => {118const { actions } = props;119actions.setModal("copy-limit");120},121},122"collaborator-policy": {123icon: "mail",124label: course.collaborator_policy,125button: defineMessage({126id: "course.commands.collaborator-policy.button",127defaultMessage: "Collab",128description: "Short label on a button, abbrivation of 'Collaborators'",129}),130title: defineMessage({131id: "course.commands.collaborator-policy.tooltip",132defaultMessage:133"Control if the owner and any collaborator on this student project may add collaborators to this project.",134}),135onClick: ({ props }) => {136const { actions } = props;137actions.setModal("collaborator-policy");138},139},140"restrict-student-projects": {141icon: "lock",142label: course.restrict_student_projects,143button: labels.restrict,144title: defineMessage({145id: "course.commands.restrict-student-projects.toolteip",146defaultMessage: "Remove functionality from student projects",147}),148onClick: ({ props }) => {149const { actions } = props;150actions.setModal("restrict-student-projects");151},152},153nbgrader: {154icon: "graduation-cap",155label: defineMessage({156id: "course.commands.nbgrader.label",157defaultMessage: "Configure Nbgrader",158}),159button: labels.nbgrader,160title: defineMessage({161id: "course.commands.nbgrader.tooltip",162defaultMessage: "Configure how nbgrader works.",163}),164onClick: ({ props }) => {165const { actions } = props;166actions.setModal("nbgrader");167},168},169"software-environment": {170icon: "laptop",171label: labels.software_environment,172button: labels.software,173title: defineMessage({174id: "course.commands.software-environment.tooltip",175defaultMessage:176"Configure the software environment that all student projects will use.",177}),178onClick: ({ props }) => {179const { actions } = props;180actions.setModal("software-environment");181},182},183"network-file-systems": {184icon: "database",185label: labels.cloud_storage_remote_filesystems,186button: "Nbgrader",187title: defineMessage({188id: "course.commands.network-file-systems.tooltip",189defaultMessage:190"Give all student projects read-only access to the same cloud stores and remote file systems as this instructor project.",191}),192onClick: ({ props }) => {193const { actions } = props;194actions.setModal("network-file-systems");195},196},197"env-variables": {198icon: ENV_VARS_ICON,199label: defineMessage({200id: "course.commands.env-variables.label",201defaultMessage: "Configure Environment Variables",202}),203button: labels.environment,204title: defineMessage({205id: "course.commands.env-variables.tooltip",206defaultMessage:207"Configure whether or not student projects inherit the environment variables of this instructor project.",208}),209onClick: ({ props }) => {210const { actions } = props;211actions.setModal("env-variables");212},213},214"configuration-copying": {215icon: "copy",216label: defineMessage({217id: "course.commands.configuration-copying.label",218defaultMessage: "Copy Course Configuration",219}),220button: labels.config,221title: defineMessage({222id: "course.commands.configuration-copying.tooltip",223defaultMessage: "Copy configuration from this course to other courses.",224}),225onClick: ({ props }) => {226const { actions } = props;227actions.setModal("configuration-copying");228},229},230upgrades: {231icon: "gears",232label: defineMessage({233id: "course.commands.upgrades.label",234defaultMessage: "Configure Upgrades (Student or Instructor Pay)",235}),236button: labels.upgrades,237title: defineMessage({238id: "course.commands.upgrades.tooltip",239defaultMessage:240"Use a license to upgrade all projects, or require your students to purchase a specific license.",241}),242onClick: ({ props }) => {243const { actions } = props;244actions.setModal("upgrades");245},246},247"start-all-projects": {248icon: "bolt",249label: defineMessage({250id: "course.commands.start-all-projects.label",251defaultMessage: "Start or Stop all Student Projects",252}),253button: labels.start_all,254title: defineMessage({255id: "course.commands.start-all-projects.tooltip",256defaultMessage:257"You can start all projects associated with this course so they are immediately ready for your students to use.",258}),259onClick: ({ props }) => {260const { actions } = props;261actions.setModal("start-all-projects");262},263},264"terminal-command": {265icon: "terminal",266label: defineMessage(course.run_terminal_command_title),267button: labels.terminal,268title: defineMessage({269id: "course.commands.terminal-command.tooltip",270defaultMessage:271"Run a bash terminal command in the home directory of all student projects. Up to 30 commands run in parallel, with a timeout of 1 minutes.",272}),273onClick: ({ props }) => {274const { actions } = props;275actions.setModal("terminal-command");276},277},278"reconfigure-all-projects": {279icon: "mail",280label: course.reconfigure_all_projects,281button: labels.reconfigure,282title: defineMessage({283id: "course.commands.reconfigure-all-projects.tooltip",284defaultMessage:285"Update all projects with correct students, descriptions, etc.",286}),287onClick: ({ props }) => {288const { actions } = props;289actions.setModal("reconfigure-all-projects");290},291},292"export-grades": {293icon: "table",294label: course.export_grades,295button: course.grades,296title: defineMessage({297id: "course.commands.export-grades.tooltip",298defaultMessage:299"Export all the grades you have recorded for students in your course to a csv or Python file.",300}),301onClick: ({ props }) => {302const { actions } = props;303actions.setModal("export-grades");304},305},306"resend-invites": {307icon: "mail",308label: course.resend_invites,309button: labels.invites,310title: defineMessage({311id: "course.commands.resend-invites.tooltip",312defaultMessage:313"Send another email to every student who didn't sign up yet. This sends a maximum of one email every 1 day.",314}),315onClick: ({ props }) => {316const { actions } = props;317actions.setModal("resend-invites");318},319},320"copy-missing-handouts-and-assignments": {321icon: "graph",322label: course.copy_missing_handouts_assignments,323button: defineMessage({324id: "course.commands.copy-missing-handouts-and-assignments.button",325defaultMessage: "Copy Missing",326}),327title: defineMessage({328id: "course.commands.copy-missing-handouts-and-assignments.tooltip",329defaultMessage:330"If you add new students to your course, you can ensure they have all the assignments and handouts that you have already assigned to other students in the course.",331}),332onClick: ({ props }) => {333const { actions } = props;334actions.setModal("copy-missing-handouts-and-assignments");335},336},337"empty-trash": {338icon: "trash",339label: labels.empty_trash,340button: labels.trash,341title: defineMessage({342id: "course.commands.empty-trash.tooltip",343defaultMessage:344"Empty trash by purging deleted students, assignments, and handouts.",345}),346onClick: ({ props }) => {347const { actions } = props;348actions.setModal("empty-trash");349},350},351"delete-student-projects": {352icon: "trash",353label: defineMessage(course.delete_student_projects),354button: labels.delete,355title: defineMessage({356id: "course.commands.delete-student-projects.tooltip",357defaultMessage:358"If for some reason you would like to delete all the student projects created for this course, you may do so by clicking above.",359}),360onClick: ({ props }) => {361const { actions } = props;362actions.setModal("delete-student-projects");363},364},365"delete-students": {366icon: "trash",367label: defineMessage({368id: "course.commands.delete-students.label",369defaultMessage: "Delete Students",370}),371button: labels.delete,372title: defineMessage({373id: "course.commands.delete-students.tooltip",374defaultMessage:375"Student projects will not be deleted. If you make a mistake, students can still be undeleted from the Student tab or using TimeTravel.",376}),377onClick: ({ props }) => {378const { actions } = props;379actions.setModal("delete-students");380},381},382"delete-shared-project": {383icon: "trash",384label: course.delete_shared_project,385button: labels.delete,386title: defineMessage({387id: "course.commands.delete-shared-project.tooltip",388defaultMessage:389"If it exists, delete the common shared project, which everybody has access to.",390}),391onClick: ({ props }) => {392const { actions } = props;393actions.setModal("delete-shared-project");394},395},396"create-shared-project": {397icon: "users",398label: course.create_shared_project,399button: defineMessage({400id: "course.commands.create-shared-project.button",401defaultMessage: "Shared",402}),403title: defineMessage({404id: "course.commands.create-shared-project.tooltip",405defaultMessage:406"Create a single common shared project, which everybody – students and all collaborators on this project (your TAs and other instructors) – have write access to.",407}),408onClick: ({ props }) => {409const { actions } = props;410actions.setModal("create-shared-project");411},412},413} as const;414415416