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/next/pages/pricing/courses.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Layout, List } from "antd";67import { Icon, IconName } from "@cocalc/frontend/components/icon";8import { LicenseIdleTimeouts, Uptime } from "@cocalc/util/consts/site-license";9import { compute_cost } from "@cocalc/util/licenses/purchase/compute-cost";10import { discount_pct } from "@cocalc/util/licenses/purchase/consts";11import { PurchaseInfo } from "@cocalc/util/licenses/purchase/types";12import { money } from "@cocalc/util/licenses/purchase/utils";13import { COLORS } from "@cocalc/util/theme";14import Footer from "components/landing/footer";15import Head from "components/landing/head";16import Header from "components/landing/header";17import PricingItem, { Line } from "components/landing/pricing-item";18import { Paragraph, Title } from "components/misc";19import A from "components/misc/A";20import { listedPrices } from "components/share/pricing";21import { LinkToStore, StoreConf } from "components/store/link";22import { encodeRange } from "components/store/quota-query-params";23import { MAX_WIDTH } from "lib/config";24import { Customize } from "lib/customize";25import withCustomize from "lib/with-customize";2627interface Item {28title: string;29icon: IconName;30teachers: number;31students: number;32duration: string;33disk: number;34shared_ram: number;35shared_cores: number;36academic: boolean;37retail?: number;38online: number;39uptime?: string;40conf: StoreConf;41}4243const training: Item = (() => {44const students = 10;45const days = 5;46const conf = {47run_limit: students + 1,48user: "business",49days,50ram: 5,51disk: 5,52cpu: 1,53uptime: "medium" as Uptime,54start: new Date(),55end: new Date(new Date().getTime() + days * 24 * 60 * 60 * 1000),56} as const;5758const profPrice = compute_cost({59type: "quota",60user: conf.user,61upgrade: "custom",62quantity: conf.run_limit,63subscription: "no",64start: conf.start,65end: conf.end,66custom_ram: conf.ram,67custom_cpu: conf.cpu,68custom_disk: conf.disk,69custom_member: true,70custom_dedicated_ram: 0,71custom_dedicated_cpu: 0,72custom_uptime: conf.uptime,73} as PurchaseInfo);7475return {76title: `${conf.days} Day Professional Training`,77icon: "battery-quarter",78teachers: 1,79students,80duration: `${conf.days} days`,81disk: conf.disk,82uptime: LicenseIdleTimeouts[conf.uptime].labelShort,83shared_ram: conf.ram,84dedicated_ram: 0,85shared_cores: conf.cpu,86dedicated_cores: 0,87academic: false,88online: profPrice.cost,89conf,90};91})();9293const courseSmall: Item = (() => {94const students = 10;95const days = 30;96const conf = {97run_limit: students + 1,98days,99ram: 2,100disk: 3,101cpu: 1,102uptime: "short",103user: "academic",104start: new Date(),105end: new Date(new Date().getTime() + days * 24 * 60 * 60 * 1000),106} as const;107108const price = compute_cost({109type: "quota",110user: conf.user,111upgrade: "custom",112quantity: conf.run_limit,113subscription: "no",114start: conf.start,115end: conf.end,116custom_ram: conf.ram,117custom_cpu: conf.cpu,118custom_disk: conf.disk,119custom_member: true,120custom_dedicated_ram: 0,121custom_dedicated_cpu: 0,122custom_uptime: conf.uptime,123} as PurchaseInfo);124125return {126title: `${students} students for ${conf.days} days`,127icon: "battery-half",128teachers: 1,129students,130duration: `${conf.days} days`,131disk: conf.disk,132uptime: LicenseIdleTimeouts[conf.uptime].labelShort,133shared_ram: conf.ram,134shared_cores: conf.cpu,135academic: true,136retail: price.cost,137online: price.cost,138conf,139};140})();141142const courseLarge: Item = (() => {143const students = 150;144const months = 4;145const days = months * 30;146const conf = {147run_limit: students + 1,148days,149user: "academic",150ram: 2,151disk: 3,152cpu: 1,153uptime: "short",154start: new Date(),155end: new Date(new Date().getTime() + days * 24 * 60 * 60 * 1000),156} as const;157158const price = compute_cost({159type: "quota",160user: conf.user,161upgrade: "custom",162quantity: conf.run_limit,163subscription: "no",164start: conf.start,165end: conf.end,166custom_ram: conf.ram,167custom_cpu: conf.cpu,168custom_disk: conf.disk,169custom_member: true,170custom_dedicated_ram: 0,171custom_dedicated_cpu: 0,172custom_uptime: conf.uptime,173} as PurchaseInfo);174175return {176title: `${students} Students for ${months} Months`,177icon: "battery-full",178teachers: 1,179students,180duration: `${days} days`,181disk: conf.disk,182uptime: LicenseIdleTimeouts[conf.uptime].labelShort,183shared_ram: conf.ram,184shared_cores: conf.cpu,185academic: true,186retail: price.cost,187online: price.cost,188conf,189};190})();191192const data: Item[] = [training, courseSmall, courseLarge];193194export default function Courses({ customize }) {195const { siteName } = customize;196return (197<Customize value={customize}>198<Head title={`${siteName} – Pricing – Course Licenses`} />199<Layout>200<Header page="pricing" subPage="courses" />201<Layout.Content style={{ backgroundColor: "white" }}>202<Body />203<Footer />204</Layout.Content>205</Layout>206</Customize>207);208}209210function Body(): JSX.Element {211return (212<div213style={{214maxWidth: MAX_WIDTH,215margin: "15px auto",216padding: "15px",217backgroundColor: "white",218}}219>220<div style={{ textAlign: "center" }}>221<Title level={1}>222<Icon name="graduation-cap" style={{ marginRight: "30px" }} />223CoCalc – Course Licenses224</Title>225</div>226<Paragraph>227You{" "}228<A href="https://doc.cocalc.com/teaching-instructors.html">229teach a course230</A>{" "}231on <span>CoCalc</span> by creating one project for each student, sending232your students assignments and handouts, then guiding their progress233using collaboration and chat. You can then collect, grade, comment on,234and return their work.235</Paragraph>236<Paragraph>237You will need to purchase an appropriate license for your course, or238have the students pay the one-time fee, since CoCalc is not funded by239advertisers or other intrusive methods.240</Paragraph>241242<h2>How to get started?</h2>243<Paragraph>244You can{" "}245<A href="/store/site-license" external>246purchase a license for your course247</A>{" "}248in the{" "}249<A href="/store" external>250store251</A>252.253</Paragraph>254<Paragraph>255Minimal upgrades might be okay for beginner courses, but we find that256many data and computational science courses run better with additional257RAM and CPU. <A href="mailto:[email protected]">Contact us</A> if you have258questions or need a trial license to test out different possibilities.259</Paragraph>260<Paragraph>261Once you obtain a license key,{" "}262<A href="https://doc.cocalc.com/teaching-upgrade-course.html">263apply it to all your student projects264</A>265.266</Paragraph>267<Paragraph>268You can acquire several licenses, e.g., to partition a semester into269smaller parts with different requirements, or to keep upgrades separate270between certain groups of courses or instructors.271</Paragraph>272273<Title level={2}>Payment options</Title>274<Paragraph>275<ul style={{ paddingLeft: "20px" }}>276<li>277<b>278<A href="https://doc.cocalc.com/teaching-upgrade-course.html#teacher-or-institution-pays-for-upgrades">279You or your institution pays280</A>281</b>{" "}282for one or more license upgrades. You distribute the license283upgrades to all projects of the course via the course configuration284tab of the course management interface.285</li>286<li>287<b>288<A href="https://doc.cocalc.com/teaching-upgrade-course.html#students-pay-for-upgrades">289Students pay a one-time fee.290</A>291</b>{" "}292In the configuration frame of the course management file, you opt to293require all students to pay a one-time fee to upgrade their own294projects. You can decide on the exact parameters of the license the295students will purchase, depending on the needs for your course.296</li>297</ul>298</Paragraph>299300<Title level={2}>Examples</Title>301<Paragraph>302Here are three typical configurations, which you can{" "}303<A href="/store/site-license" external>304modify and purchase here305</A>306. All parameters can be adjusted to fit your needs. Listed upgrades are307for each project. Exact prices may vary. Only self-service online308purchases are available below $100.309</Paragraph>310311<List312grid={{ gutter: 15, column: 3, xs: 1, sm: 1 }}313dataSource={data}314renderItem={(item) => {315const conf = {316...item.conf,317period: "range" as "range",318range: encodeRange([item.conf.start, item.conf.end]),319};320return (321<PricingItem title={item.title} icon={item.icon}>322<Line amount={item.teachers} desc="Teacher" />323<Line amount={item.students} desc="Students" />324<Line amount={item.duration} desc="Duration" />325<Line amount={item.uptime} desc="Idle timeout" />326<Line amount={item.shared_ram} desc="Shared RAM" />327<Line amount={item.shared_cores} desc="Shared CPU" />328<Line amount={item.disk} desc="Disk space" />329{item.academic && (330<Line amount={`${discount_pct}%`} desc="Academic discount" />331)}332<br />333<br />334<div>335<span336style={{337fontWeight: "bold",338fontSize: "18pt",339color: COLORS.GRAY_DD,340}}341>342{money(item.online, true)}343</span>{" "}344</div>345<LinkToStore conf={conf} />346</PricingItem>347);348}}349/>350351{listedPrices()}352353<Title level={2}>Contact us</Title>354<Paragraph>355To learn more about your teaching options, email us at{" "}356<A href="mailto:[email protected]">[email protected]</A> with a description357of your specific requirements.358</Paragraph>359</div>360);361}362363export async function getServerSideProps(context) {364return await withCustomize({ context });365}366367368