From bb2b1bd0fbeef0a4f6dfe1990c921964e38557f6 Mon Sep 17 00:00:00 2001
From: Will Crichton <wcrichto@cs.stanford.edu>
Date: Wed, 11 Sep 2024 17:33:37 -0700
Subject: [PATCH] Release v0.3.8 (#50)

* Release v0.3.8

* Remove redundant CI rule
---
 .github/workflows/main.yml               |  4 ----
 Cargo.lock                               |  6 +++---
 crates/mdbook-quiz-schema/Cargo.toml     |  2 +-
 crates/mdbook-quiz-validate/Cargo.toml   |  2 +-
 crates/mdbook-quiz/Cargo.toml            |  2 +-
 js/package.json                          |  2 +-
 js/packages/quiz-embed/package.json      |  2 +-
 js/packages/quiz/package.json            |  2 +-
 js/packages/quiz/src/components/quiz.tsx | 10 +++++++---
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a33b8cb..34e2356 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,15 +6,11 @@ on:
       - "**"
     tags-ignore:
       - "v*"
-  pull_request:
-    branches:
-      - "**"
 
 env:
   AQUASCOPE_VERSION: 0.3.1
   AQUASCOPE_TOOLCHAIN: nightly-2023-08-25
 
-
 jobs:
   tests:
     runs-on: ubuntu-latest
diff --git a/Cargo.lock b/Cargo.lock
index 3c9718f..83975f3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1181,7 +1181,7 @@ dependencies = [
 
 [[package]]
 name = "mdbook-quiz"
-version = "0.3.7"
+version = "0.3.8"
 dependencies = [
  "anyhow",
  "html-escape",
@@ -1200,7 +1200,7 @@ dependencies = [
 
 [[package]]
 name = "mdbook-quiz-schema"
-version = "0.3.7"
+version = "0.3.8"
 dependencies = [
  "schemars",
  "serde",
@@ -1211,7 +1211,7 @@ dependencies = [
 
 [[package]]
 name = "mdbook-quiz-validate"
-version = "0.3.7"
+version = "0.3.8"
 dependencies = [
  "anyhow",
  "fluid-let",
diff --git a/crates/mdbook-quiz-schema/Cargo.toml b/crates/mdbook-quiz-schema/Cargo.toml
index 272d824..405ffc1 100644
--- a/crates/mdbook-quiz-schema/Cargo.toml
+++ b/crates/mdbook-quiz-schema/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "mdbook-quiz-schema"
-version = "0.3.7"
+version = "0.3.8"
 authors = ["Will Crichton <crichton.will@gmail.com>"]
 description = "Schema for quizzes used in mdbook-quiz"
 license = "MIT OR Apache-2.0"
diff --git a/crates/mdbook-quiz-validate/Cargo.toml b/crates/mdbook-quiz-validate/Cargo.toml
index 46b1963..67ccbaa 100644
--- a/crates/mdbook-quiz-validate/Cargo.toml
+++ b/crates/mdbook-quiz-validate/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "mdbook-quiz-validate"
-version = "0.3.7"
+version = "0.3.8"
 authors = ["Will Crichton <crichton.will@gmail.com>"]
 description = "Input validation for quizzes used in mdbook-quiz"
 license = "MIT OR Apache-2.0"
diff --git a/crates/mdbook-quiz/Cargo.toml b/crates/mdbook-quiz/Cargo.toml
index 3d053d8..a0bd6a1 100644
--- a/crates/mdbook-quiz/Cargo.toml
+++ b/crates/mdbook-quiz/Cargo.toml
@@ -3,7 +3,7 @@ name = "mdbook-quiz"
 authors = ["Will Crichton <crichton.will@gmail.com>"]
 description = "Interactive quizzes for your mdBook"
 license = "MIT OR Apache-2.0"
-version = "0.3.7"
+version = "0.3.8"
 edition = "2021"
 include = ["/src", "/js"]
 repository = "https://github.com/cognitive-engineering-lab/mdbook-quiz"
diff --git a/js/package.json b/js/package.json
index 3417ccd..1d27484 100644
--- a/js/package.json
+++ b/js/package.json
@@ -1,7 +1,7 @@
 {
   "private": true,
   "depot": {
-    "depot-version": "0.2.17"
+    "depot-version": "0.2.18"
   },
   "devDependencies": {
     "@biomejs/biome": "^1.8.3",
diff --git a/js/packages/quiz-embed/package.json b/js/packages/quiz-embed/package.json
index d5a3187..36a9bc4 100644
--- a/js/packages/quiz-embed/package.json
+++ b/js/packages/quiz-embed/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@wcrichto/quiz-embed",
-  "version": "0.3.5",
+  "version": "0.3.8",
   "depot": {
     "platform": "browser"
   },
diff --git a/js/packages/quiz/package.json b/js/packages/quiz/package.json
index 4ffea14..acf6d02 100644
--- a/js/packages/quiz/package.json
+++ b/js/packages/quiz/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@wcrichto/quiz",
-  "version": "0.3.5",
+  "version": "0.3.8",
   "files": [
     "dist"
   ],
diff --git a/js/packages/quiz/src/components/quiz.tsx b/js/packages/quiz/src/components/quiz.tsx
index a7d3620..89708a3 100644
--- a/js/packages/quiz/src/components/quiz.tsx
+++ b/js/packages/quiz/src/components/quiz.tsx
@@ -112,11 +112,13 @@ interface QuizState {
 let loadState = ({
   quiz,
   answerStorage,
-  cacheAnswers
+  cacheAnswers,
+  autoStart
 }: {
   quiz: Quiz;
   answerStorage: AnswerStorage;
   cacheAnswers?: boolean;
+  autoStart?: boolean;
 }): QuizState => {
   let stored = answerStorage.load();
 
@@ -143,7 +145,7 @@ let loadState = ({
     };
   } else {
     return {
-      started: false,
+      started: autoStart || false,
       index: 0,
       attempt: 0,
       confirmedDone: false,
@@ -301,6 +303,7 @@ export interface QuizViewConfig {
   cacheAnswers?: boolean;
   allowRetry?: boolean;
   showBugReporter?: boolean;
+  autoStart?: boolean;
 }
 
 export type QuizViewProps = QuizViewConfig & {
@@ -354,7 +357,8 @@ export let QuizView: React.FC<QuizViewProps> = observer(
       loadState({
         quiz: config.quiz,
         answerStorage,
-        cacheAnswers: config.cacheAnswers
+        cacheAnswers: config.cacheAnswers,
+        autoStart: config.autoStart
       })
     );