diff --git a/src/lib/images/questionTemplates/convertAngle.png b/src/lib/images/questionTemplates/convertAngle.png new file mode 100644 index 0000000..f06701e Binary files /dev/null and b/src/lib/images/questionTemplates/convertAngle.png differ diff --git a/src/lib/images/questionTemplates/derivativeSymbolic.png b/src/lib/images/questionTemplates/derivativeSymbolic.png new file mode 100644 index 0000000..be5cd9b Binary files /dev/null and b/src/lib/images/questionTemplates/derivativeSymbolic.png differ diff --git a/src/lib/images/questionTemplates/dynamicImage.png b/src/lib/images/questionTemplates/dynamicImage.png new file mode 100644 index 0000000..98a3d50 Binary files /dev/null and b/src/lib/images/questionTemplates/dynamicImage.png differ diff --git a/src/lib/images/questionTemplates/fixedEquation.png b/src/lib/images/questionTemplates/fixedEquation.png new file mode 100644 index 0000000..9f1491f Binary files /dev/null and b/src/lib/images/questionTemplates/fixedEquation.png differ diff --git a/src/lib/images/questionTemplates/graphMatrix.png b/src/lib/images/questionTemplates/graphMatrix.png new file mode 100644 index 0000000..0c6dbc2 Binary files /dev/null and b/src/lib/images/questionTemplates/graphMatrix.png differ diff --git a/src/lib/images/questionTemplates/inputText.png b/src/lib/images/questionTemplates/inputText.png new file mode 100644 index 0000000..063b6f7 Binary files /dev/null and b/src/lib/images/questionTemplates/inputText.png differ diff --git a/src/lib/images/questionTemplates/productMatrices.png b/src/lib/images/questionTemplates/productMatrices.png new file mode 100644 index 0000000..e3bcb79 Binary files /dev/null and b/src/lib/images/questionTemplates/productMatrices.png differ diff --git a/src/lib/images/questionTemplates/randomEquation.png b/src/lib/images/questionTemplates/randomEquation.png new file mode 100644 index 0000000..ecad21d Binary files /dev/null and b/src/lib/images/questionTemplates/randomEquation.png differ diff --git a/src/lib/images/questionTemplates/selectBird.png b/src/lib/images/questionTemplates/selectBird.png new file mode 100644 index 0000000..0b17ff9 Binary files /dev/null and b/src/lib/images/questionTemplates/selectBird.png differ diff --git a/src/lib/images/questionTemplates/selectEven.png b/src/lib/images/questionTemplates/selectEven.png new file mode 100644 index 0000000..c4e4aa2 Binary files /dev/null and b/src/lib/images/questionTemplates/selectEven.png differ diff --git a/src/lib/images/questionTemplates/selectPlanet.png b/src/lib/images/questionTemplates/selectPlanet.png new file mode 100644 index 0000000..365ed98 Binary files /dev/null and b/src/lib/images/questionTemplates/selectPlanet.png differ diff --git a/src/lib/images/questionTemplates/selectRainbowColor.png b/src/lib/images/questionTemplates/selectRainbowColor.png new file mode 100644 index 0000000..101a043 Binary files /dev/null and b/src/lib/images/questionTemplates/selectRainbowColor.png differ diff --git a/src/lib/images/questionTemplates/selectRandomNumber.png b/src/lib/images/questionTemplates/selectRandomNumber.png new file mode 100644 index 0000000..4c14a02 Binary files /dev/null and b/src/lib/images/questionTemplates/selectRandomNumber.png differ diff --git a/src/lib/images/questionTemplates/selectTrueFalse.png b/src/lib/images/questionTemplates/selectTrueFalse.png new file mode 100644 index 0000000..e000144 Binary files /dev/null and b/src/lib/images/questionTemplates/selectTrueFalse.png differ diff --git a/src/pages/gallery/questions/index.tsx b/src/pages/gallery/questions/index.tsx index e096c5d..ebba1ba 100644 --- a/src/pages/gallery/questions/index.tsx +++ b/src/pages/gallery/questions/index.tsx @@ -1,31 +1,73 @@ import React from "react"; import classnames from "classnames"; -import { GetStaticProps } from "next"; import Link from "next/link"; import Head from "next/head"; -import Image from "next/image"; +import Image, { ImageProps } from "next/image"; import { Heading } from "../../../components/Heading"; import { PageBanner } from "../../../components/Banner"; import { BannerCTA } from "../../../components/CallToActionBanner"; import { LinkButton } from "../../../components/LinkButton"; -import { getQuestions } from "../../../lib/gallery/questions"; import styles from "./index.module.scss"; import questionImage from "../../../lib/images/question.png"; -interface Question { - title: string; - slug: string; - summary: string; - imageUrl?: string; +{ + /* Template Question Images */ } +import selectBird from "../../../lib/images/questionTemplates/selectBird.png"; +import selectRandomNumber from "../../../lib/images/questionTemplates/selectRandomNumber.png"; +import selectRainbowColor from "../../../lib/images/questionTemplates/selectRainbowColor.png"; +import selectPlanet from "../../../lib/images/questionTemplates/selectPlanet.png"; +import selectTrueFalse from "../../../lib/images/questionTemplates/selectTrueFalse.png"; +import selectEven from "../../../lib/images/questionTemplates/selectEven.png"; +import randomEquation from "../../../lib/images/questionTemplates/randomEquation.png"; +import fixedEquation from "../../../lib/images/questionTemplates/fixedEquation.png"; +import convertAngle from "../../../lib/images/questionTemplates/convertAngle.png"; +import dynamicImage from "../../../lib/images/questionTemplates/dynamicImage.png"; +import graphMatrix from "../../../lib/images/questionTemplates/graphMatrix.png"; +import productMatrices from "../../../lib/images/questionTemplates/productMatrices.png"; +import derivativeSymbolic from "../../../lib/images/questionTemplates/derivativeSymbolic.png"; +import inputText from "../../../lib/images/questionTemplates/inputText.png"; -interface GalleryIndexProps { - questions: Question[]; +interface TemplateCardProps { + title: string; + href: string; + image: ImageProps["src"]; + children: React.ReactNode; } -const GalleryIndex: React.FC = ({ questions }) => { +const TemplateCard: React.FC = ({ + title, + href, + image, + children, +}) => { + return ( +
+ + {title} + +
+ +

{title}

+ + {children} +
+
+ ); +}; + +export default function QuestionTemplate() { return ( @@ -77,47 +119,160 @@ const GalleryIndex: React.FC = ({ questions }) => { -
+
- Question Gallery + Question templates

- Check out the question gallery with example questions that take - full advantage of the PrairieLearn platform. + Check out these template questions - they can be great resources + when creating your own questions.

+
+
+
-
- {questions.map((question) => { - const galleryHref = `/gallery/questions/${question.slug}`; - return ( -
- {question.imageUrl && ( - - {/* Fit all images within 4:3 aspect ratio box*/} +
+
+
+ Multiple-choice and checkbox answers +
+
+ + Correct answer and distractors are computed based on randomized + input parameters. + + + Correct answer and distractors are randomly selected from a list + of several correct answers and distractors. + + + Correct answer and distractors are randomly selected from a list + of images. + + + Correct answer and distractors are randomly selected from a list + which is dynamically generated based on the choice of randomized + prompt. + + + Randomly selects the prompt from a list and its corresponding True + / False answer. Ensures the True option always appears first. + + + Randomly selects the question prompt from and its corresponding + correct/incorrect answers. + +
+
+
- question preview image - - )} -
- -

{question.title}

- -

{question.summary}

-
-
- ); - })} -
+
+
+
+ Numerical Answers +
+
+ + Computes the numerical value for a fixed mathematical expression + given two randomized input parameters. + + + Computes the numerical value for a mathematical expression + randomly generated from a list of options, given two randomized + input parameters. + + + Computes the answer, expected to be an integer, given a randomized + parameter. + + + Computes the answer, expected to be an integer, given a + dynamically generated image from randomized input parameters. + +
+
+
+ +
+
+
+ Matrix answers +
+
+ + Dynamically generates a randomized graph with nodes and edges, and + the answer is the corresponding adjacency matrix. + + + Generates two randomized matrices and provides them as input in + both Matlab and Python format. The computed answer can also be + provided in either formats. + +
+
+
+ +
+
+
+ Text answers +
+
+ + Prompt and correct answer are randomly selected from a list of + options. Correct answer is checked as a string, with all + whitespaces removed. + +
+
+
+ +
+
+
+ Symbolic expressions +
+
+ + Evaluates if a symbolic submission of a mathematical expression + matches the correct answer, which is generated at random. +
@@ -130,22 +285,4 @@ const GalleryIndex: React.FC = ({ questions }) => { /> ); -}; - -export default GalleryIndex; - -export const getStaticProps: GetStaticProps = async () => { - const rawQuestions = await getQuestions(); - const questions = rawQuestions.map(({ title, slug, summary, image }) => ({ - title, - slug, - summary, - imageUrl: image?.url, - })); - - return { - props: { - questions, - }, - }; -}; +}