first working version
This commit is contained in:
297
exam_system/data/input/cpp/2025-10/cpp-easy-v1.json
Normal file
297
exam_system/data/input/cpp/2025-10/cpp-easy-v1.json
Normal file
@@ -0,0 +1,297 @@
|
||||
{
|
||||
"examId": "cpp-easy-v1",
|
||||
"title": "C++ Fundamentals - Easy Level",
|
||||
"subject": "C++",
|
||||
"difficulty": "beginner",
|
||||
"durationMinutes": 40,
|
||||
"passingScore": 70,
|
||||
"sections": [
|
||||
{
|
||||
"id": "basics",
|
||||
"title": "C++ Basics & Syntax",
|
||||
"questions": [
|
||||
{
|
||||
"id": "q1",
|
||||
"type": "single_choice",
|
||||
"prompt": "What is the correct file extension for a C++ source file?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": ".c" },
|
||||
{ "key": "B", "text": ".cpp" },
|
||||
{ "key": "C", "text": ".cxx" },
|
||||
{ "key": "D", "text": "Both B and C are correct" }
|
||||
],
|
||||
"answer": "D",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q2",
|
||||
"type": "true_false",
|
||||
"prompt": "In C++, every program must have a main() function.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q3",
|
||||
"type": "single_choice",
|
||||
"prompt": "Which header file is required to use cout in C++?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "#include <stdio.h>" },
|
||||
{ "key": "B", "text": "#include <iostream>" },
|
||||
{ "key": "C", "text": "#include <conio.h>" },
|
||||
{ "key": "D", "text": "#include <stream>" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q4",
|
||||
"type": "multiple_choices",
|
||||
"prompt": "Which of the following are valid C++ data types? (Select all that apply)",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "int" },
|
||||
{ "key": "B", "text": "boolean" },
|
||||
{ "key": "C", "text": "float" },
|
||||
{ "key": "D", "text": "char" }
|
||||
],
|
||||
"answer": ["A", "C", "D"],
|
||||
"partialCredit": true,
|
||||
"allowIDK": true,
|
||||
"points": 10
|
||||
},
|
||||
{
|
||||
"id": "q5",
|
||||
"type": "true_false",
|
||||
"prompt": "C++ is case-sensitive, meaning 'Variable' and 'variable' are different identifiers.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "variables_operators",
|
||||
"title": "Variables & Operators",
|
||||
"questions": [
|
||||
{
|
||||
"id": "q6",
|
||||
"type": "single_choice",
|
||||
"prompt": "Which operator is used to assign a value to a variable in C++?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "==" },
|
||||
{ "key": "B", "text": "=" },
|
||||
{ "key": "C", "text": "===" },
|
||||
{ "key": "D", "text": ":=" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q7",
|
||||
"type": "multiple_choices",
|
||||
"prompt": "Which of the following are arithmetic operators in C++? (Select all that apply)",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "+" },
|
||||
{ "key": "B", "text": "%" },
|
||||
{ "key": "C", "text": "&&" },
|
||||
{ "key": "D", "text": "*" }
|
||||
],
|
||||
"answer": ["A", "B", "D"],
|
||||
"partialCredit": true,
|
||||
"allowIDK": true,
|
||||
"points": 10
|
||||
},
|
||||
{
|
||||
"id": "q8",
|
||||
"type": "true_false",
|
||||
"prompt": "In C++, you must declare a variable before using it.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q9",
|
||||
"type": "single_choice",
|
||||
"prompt": "What is the result of: 10 % 3 in C++?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "3" },
|
||||
{ "key": "B", "text": "1" },
|
||||
{ "key": "C", "text": "3.33" },
|
||||
{ "key": "D", "text": "0" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "control_flow",
|
||||
"title": "Control Flow & Loops",
|
||||
"questions": [
|
||||
{
|
||||
"id": "q10",
|
||||
"type": "single_choice",
|
||||
"prompt": "Which keyword is used for conditional statements in C++?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "when" },
|
||||
{ "key": "B", "text": "if" },
|
||||
{ "key": "C", "text": "check" },
|
||||
{ "key": "D", "text": "condition" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q11",
|
||||
"type": "true_false",
|
||||
"prompt": "A 'while' loop checks the condition before executing the loop body.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q12",
|
||||
"type": "multiple_choices",
|
||||
"prompt": "Which are valid loop types in C++? (Select all that apply)",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "for loop" },
|
||||
{ "key": "B", "text": "while loop" },
|
||||
{ "key": "C", "text": "do-while loop" },
|
||||
{ "key": "D", "text": "repeat-until loop" }
|
||||
],
|
||||
"answer": ["A", "B", "C"],
|
||||
"partialCredit": true,
|
||||
"allowIDK": true,
|
||||
"points": 10
|
||||
},
|
||||
{
|
||||
"id": "q13",
|
||||
"type": "single_choice",
|
||||
"prompt": "What does the 'break' statement do in a loop?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "Skips the current iteration" },
|
||||
{ "key": "B", "text": "Exits the loop completely" },
|
||||
{ "key": "C", "text": "Pauses the loop" },
|
||||
{ "key": "D", "text": "Restarts the loop" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "functions_arrays",
|
||||
"title": "Functions & Arrays",
|
||||
"questions": [
|
||||
{
|
||||
"id": "q14",
|
||||
"type": "true_false",
|
||||
"prompt": "A function in C++ can return only one value.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q15",
|
||||
"type": "single_choice",
|
||||
"prompt": "How do you declare a function that doesn't return any value?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "int functionName()" },
|
||||
{ "key": "B", "text": "void functionName()" },
|
||||
{ "key": "C", "text": "null functionName()" },
|
||||
{ "key": "D", "text": "empty functionName()" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q16",
|
||||
"type": "multiple_choices",
|
||||
"prompt": "Which statements about arrays in C++ are true? (Select all that apply)",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "Array indices start at 0" },
|
||||
{ "key": "B", "text": "Arrays have fixed size once declared" },
|
||||
{ "key": "C", "text": "You can store different data types in the same array" },
|
||||
{ "key": "D", "text": "Arrays are stored in contiguous memory locations" }
|
||||
],
|
||||
"answer": ["A", "B", "D"],
|
||||
"partialCredit": true,
|
||||
"allowIDK": true,
|
||||
"points": 10
|
||||
},
|
||||
{
|
||||
"id": "q17",
|
||||
"type": "single_choice",
|
||||
"prompt": "What is the correct way to declare an integer array of size 5 in C++?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "int arr[5];" },
|
||||
{ "key": "B", "text": "array int arr[5];" },
|
||||
{ "key": "C", "text": "int[5] arr;" },
|
||||
{ "key": "D", "text": "int arr{5};" }
|
||||
],
|
||||
"answer": "A",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "pointers_basics",
|
||||
"title": "Pointers & References Basics",
|
||||
"questions": [
|
||||
{
|
||||
"id": "q18",
|
||||
"type": "true_false",
|
||||
"prompt": "A pointer stores the memory address of another variable.",
|
||||
"answer": true,
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q19",
|
||||
"type": "single_choice",
|
||||
"prompt": "Which operator is used to get the address of a variable?",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "*" },
|
||||
{ "key": "B", "text": "&" },
|
||||
{ "key": "C", "text": "@" },
|
||||
{ "key": "D", "text": "#" }
|
||||
],
|
||||
"answer": "B",
|
||||
"allowIDK": true,
|
||||
"points": 5
|
||||
},
|
||||
{
|
||||
"id": "q20",
|
||||
"type": "multiple_choices",
|
||||
"prompt": "Which are true about references in C++? (Select all that apply)",
|
||||
"choices": [
|
||||
{ "key": "A", "text": "References must be initialized when declared" },
|
||||
{ "key": "B", "text": "References can be reassigned to refer to different variables" },
|
||||
{ "key": "C", "text": "References are aliases for existing variables" },
|
||||
{ "key": "D", "text": "References cannot be NULL" }
|
||||
],
|
||||
"answer": ["A", "C", "D"],
|
||||
"partialCredit": true,
|
||||
"allowIDK": true,
|
||||
"points": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.0.0",
|
||||
"createdAt": "2025-10-21T12:00:00Z",
|
||||
"createdBy": "system",
|
||||
"tags": ["cpp", "c++", "fundamentals", "beginner", "auto-graded"],
|
||||
"description": "Comprehensive C++ fundamentals exam covering basics, variables, operators, control flow, functions, arrays, and pointer basics."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user