diff --git a/archetypes/final-test.md b/archetypes/final-test.md index 4983517..d566674 100644 --- a/archetypes/final-test.md +++ b/archetypes/final-test.md @@ -12,7 +12,7 @@ questions: # Multiple Choice Question (Single Answer) - id: "q1" text: "What keyword is used to define a function in Go?" - type: "mcq" + type: "single-answer" marks: 2 explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript." options: @@ -32,7 +32,7 @@ questions: # Short Answer Question - id: "q2" text: "Go is a statically typed language. (true/false)" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "true" case_sensitive: false @@ -41,7 +41,7 @@ questions: # Short Answer Question (Numeric) - id: "q3" text: "What is the zero value of an uninitialized int in Go?" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "0" explanation: "In Go, the zero value for numeric types like int is 0." @@ -49,8 +49,7 @@ questions: # Multiple Choice Question (Multiple Answers) - id: "q4" text: "What are the purposes of the 'defer' keyword in Go? (Select all that apply)" - type: "mcq" - multiple_answers: true + type: "multiple-answers" marks: 2 explanation: "The defer keyword is commonly used to delay function execution until the surrounding function returns, often used for cleanup tasks like closing files." options: @@ -66,4 +65,11 @@ questions: - id: "d" text: "To handle errors in a function" is_correct: false + + # True/False Question + - id: "q5" + text: "True or False: Go supports concurrency through goroutines." + type: "true-false" + answer: true + marks: 2 --- diff --git a/archetypes/optional-test.md b/archetypes/optional-test.md index 6be1d5b..16384ab 100644 --- a/archetypes/optional-test.md +++ b/archetypes/optional-test.md @@ -12,7 +12,7 @@ questions: # Multiple Choice Question (Single Answer) - id: "q1" text: "What keyword is used to define a function in Go?" - type: "mcq" + type: "single-answer" marks: 2 explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript." options: @@ -32,7 +32,7 @@ questions: # Short Answer Question - id: "q2" text: "Go is a statically typed language. (true/false)" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "true" case_sensitive: false @@ -41,7 +41,7 @@ questions: # Short Answer Question (Numeric) - id: "q3" text: "What is the zero value of an uninitialized int in Go?" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "0" explanation: "In Go, the zero value for numeric types like int is 0." @@ -49,8 +49,7 @@ questions: # Multiple Choice Question (Multiple Answers) - id: "q4" text: "What are the purposes of the 'defer' keyword in Go? (Select all that apply)" - type: "mcq" - multiple_answers: true + type: "multiple-answers" marks: 2 explanation: "The defer keyword is commonly used to delay function execution until the surrounding function returns, often used for cleanup tasks like closing files." options: @@ -66,4 +65,11 @@ questions: - id: "d" text: "To handle errors in a function" is_correct: false + + # True/False Question (Dedicated type) + - id: "q5" + text: "True or False: Go supports concurrency through goroutines." + type: "true-false" + answer: true + marks: 2 --- diff --git a/archetypes/test.md b/archetypes/test.md index cba54f9..f721fd7 100644 --- a/archetypes/test.md +++ b/archetypes/test.md @@ -12,7 +12,7 @@ questions: # Multiple Choice Question (Single Answer) - id: "q1" text: "What keyword is used to define a function in Go?" - type: "mcq" + type: "single-answer" marks: 2 explanation: "The 'func' keyword is used to declare functions in Go, similar to how 'function' is used in JavaScript." options: @@ -32,7 +32,7 @@ questions: # Short Answer Question - id: "q2" text: "Go is a statically typed language. (true/false)" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "true" case_sensitive: false @@ -41,7 +41,7 @@ questions: # Short Answer Question (Numeric) - id: "q3" text: "What is the zero value of an uninitialized int in Go?" - type: "short_answer" + type: "short-answer" marks: 2 correct_answer: "0" explanation: "In Go, the zero value for numeric types like int is 0." @@ -49,8 +49,7 @@ questions: # Multiple Choice Question (Multiple Answers) - id: "q4" text: "What are the purposes of the 'defer' keyword in Go? (Select all that apply)" - type: "mcq" - multiple_answers: true + type: "multiple-answers" marks: 2 explanation: "The defer keyword is commonly used to delay function execution until the surrounding function returns, often used for cleanup tasks like closing files." options: @@ -66,4 +65,11 @@ questions: - id: "d" text: "To handle errors in a function" is_correct: false + + # True/False Question + - id: "q5" + text: "True or False: Go supports concurrency through goroutines." + type: "true-false" + answer: true + marks: 2 --- diff --git a/layouts/test/single.html b/layouts/test/single.html index 849a158..b902a1c 100644 --- a/layouts/test/single.html +++ b/layouts/test/single.html @@ -271,6 +271,8 @@

{{ $title }}

Select all that apply
{{ else if eq $question.type "single-answer" }}
Select one answer
+ {{ else if eq $question.type "true-false" }} +
Select true or false
{{ else if eq $question.type "short-answer" }}
Type your answer below
{{ end }} @@ -290,6 +292,20 @@

{{ $title }}

{{ end }} + {{ else if (eq $question.type "true-false") }} +
+ +
+
+ +
+ {{ else if (eq $question.type "short-answer") }}