Skip to content

Commit

Permalink
Removed unnecessary setup; Fixed SimpleQuestion not asking to replace ?
Browse files Browse the repository at this point in the history
  • Loading branch information
LyonSyonII committed Nov 17, 2023
1 parent e1fd12f commit 26495ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/content/docs/first-steps/1-introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
title: Introduction
description: An introduction to RustQuest
description: An introduction to Rust Quest
---

import CodeBlock from "@components/CodeBlock.svelte";
import QuestionCard from "@components/QuestionCard.astro";

First of all, thank you for reading Rust Quest!

Thank you for reading Rust Quest!
This book is built accounting for people with zero experience about Rust or programming in general, so don't be scared, I'm sure you'll leave having learned something!

Usually, Rust is viewed as a language with a very steep learning curve, and not recommended as a first language.
Expand Down
21 changes: 8 additions & 13 deletions src/content/docs/first-steps/2-the-adventurers-guild.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: The Adventurer's Guild
description: An introduction to RustQuest
description: The hero registers into the Adventurer's Guild
---

import QuestionCard from "@components/QuestionCard.astro";
Expand All @@ -16,7 +16,6 @@ export function SimpleQuestion({
}) {
const no_dummy = code.toString().replace("?", "");
const setup = `
__VALUE__;
const VALUE: &str = "__VALUE__";
if ${checkMessed} && !VALUE.starts_with("${no_dummy}") {
println!("Seems like you've messed up the code, click the \\"Reset\\" button to return it back to its original state.");
Expand All @@ -38,11 +37,6 @@ export function SimpleQuestion({
}
export function FreeQuestion({ question, code, correct }) {
const setup = `
const VALUE: &str = "__VALUE__";
if VALUE.contains("?") {
println!("Replace ? with your answer.");
return;
}
if __VALUE__ {
println!("${correct}");
} else {
Expand All @@ -57,17 +51,17 @@ export function FreeQuestion({ question, code, correct }) {
}

Good morning!
I see you're new on this town, welcome to Newlia, where new heroes are born!
I see you're new to this town, welcome to Newlia, where new heroes are born!

Oh, you want to register as a new adventurer? And you want to choose the "Programmer" class?
Good choice! Programmers are a very versatile class, give them enough time and they can do anything!

This class requires a small test, to ensure that you have the minimum problem solving skills. It'll be just a moment.
This class requires a small test, to ensure that you have the minimum problem-solving skills. It'll be just a moment.

Please, fill up the gaps in the following statements, replace **`?`** with the correct answer.

:::note[Don't worry]
If you mess up the code, click the "Reset" button to return it back to its original state.
If you mess up the code, click the "Reset" button to return it to its original state.
:::

<SimpleQuestion
Expand Down Expand Up @@ -98,7 +92,7 @@ All right, let's up the challenge a bit.
wrong="16 / 4 != 2 * {a}, keep trying!"
/>

Well well, Mr. Calculator knows his math!
Well, well, Mr. Calculator knows his math!
Just kidding, I told you it would be pretty easy ;)

Now we'll do some comparisons, simple stuff.
Expand Down Expand Up @@ -129,9 +123,9 @@ Now we'll do some comparisons, simple stuff.

:::tip[Exercise]
See what we're doing here?
Try rewriting the exercises above exactly how the question is formulated.
Try rewriting the code of the exercises above, exactly how the question is formulated.

For example, the first one is currently saying `two hundred is smaller than ?` instead of `? is greater than two hundred`.
For example, the first one is currently saying `200 < ?` instead of `? > 200`.
:::

Excellent!
Expand All @@ -146,3 +140,4 @@ Now please sign here, and you'll be ready to take your first quest.
}
/>
</QuestionCard>

0 comments on commit 26495ae

Please sign in to comment.