From 117cddfb166dd10a0a667d9f55e6bc9a4bcf2b4f Mon Sep 17 00:00:00 2001
From: Ettore Leandro Tognoli
Date: Wed, 28 Jun 2023 10:27:49 -0300
Subject: [PATCH] add prompt language option
---
example/src/quiz.toml | 1 +
js/packages/quiz-schema/src/tracing.ts | 2 ++
js/packages/quiz/src/questions/tracing.tsx | 6 +++++-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/example/src/quiz.toml b/example/src/quiz.toml
index 3029cf5..0a025a3 100644
--- a/example/src/quiz.toml
+++ b/example/src/quiz.toml
@@ -21,6 +21,7 @@ For example, you can make a mutable variable `x` by writing: `let mut x = 1`.
[[questions]]
type = "Tracing"
+prompt.language="rust"
prompt.program = """
fn main() {
let x = 1;
diff --git a/js/packages/quiz-schema/src/tracing.ts b/js/packages/quiz-schema/src/tracing.ts
index 01bd14d..f807ce5 100644
--- a/js/packages/quiz-schema/src/tracing.ts
+++ b/js/packages/quiz-schema/src/tracing.ts
@@ -3,6 +3,8 @@ import { QuestionFields } from "./common";
export interface TracingPrompt {
/** The contents of the program to trace */
program: string;
+
+ language?: string;
}
export interface TracingAnswer {
diff --git a/js/packages/quiz/src/questions/tracing.tsx b/js/packages/quiz/src/questions/tracing.tsx
index 9d21945..2dde255 100644
--- a/js/packages/quiz/src/questions/tracing.tsx
+++ b/js/packages/quiz/src/questions/tracing.tsx
@@ -30,7 +30,11 @@ export let TracingMethods: QuestionMethods = {
{/* If the program does not pass, indicate the last line number involved in the
compiler error. */}
-
+
>
),