From e45e6842f7024d52971d5e8bdcaf6f49c8b22dd4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Thu, 9 Jul 2026 11:30:18 +0000
Subject: [PATCH 2/2] chore: apply formatting
---
backend/db/mongodb-schema.json | 110 +--
.../hpcQuestion/controller/checkAnswer.js | 2 +-
.../controller/getRandomQuestion.js | 15 +-
backend/endpoints/hpcQuestion/route.js | 2 +-
backend/scripts/data/hpcQuestion.js | 821 +++++++++---------
backend/scripts/testData.js | 6 +-
frontend/app/components/Form.jsx | 87 +-
7 files changed, 479 insertions(+), 564 deletions(-)
diff --git a/backend/db/mongodb-schema.json b/backend/db/mongodb-schema.json
index c7d0435..a2293f3 100644
--- a/backend/db/mongodb-schema.json
+++ b/backend/db/mongodb-schema.json
@@ -4,10 +4,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "day"
- ],
+ "required": ["_id", "day"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -26,12 +23,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "personId",
- "newPersonId",
- "date"
- ],
+ "required": ["_id", "personId", "newPersonId", "date"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -56,15 +48,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "bad",
- "clusterId",
- "description",
- "expectedTime",
- "good",
- "title"
- ],
+ "required": ["_id", "bad", "clusterId", "description", "expectedTime", "good", "title"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -101,12 +85,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "title",
- "description",
- "active"
- ],
+ "required": ["_id", "title", "description", "active"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -131,12 +110,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "title",
- "description",
- "active"
- ],
+ "required": ["_id", "title", "description", "active"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -161,10 +135,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "name"
- ],
+ "required": ["_id", "name"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -186,11 +157,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "name",
- "teamId"
- ],
+ "required": ["_id", "name", "teamId"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -256,11 +223,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "content",
- "instructionId"
- ],
+ "required": ["_id", "content", "instructionId"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -282,13 +245,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "instructionId",
- "note",
- "passed",
- "reportId"
- ],
+ "required": ["_id", "instructionId", "note", "passed", "reportId"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -316,13 +273,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "clusterId",
- "endDate",
- "personId",
- "startDate"
- ],
+ "required": ["_id", "clusterId", "endDate", "personId", "startDate"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -344,10 +295,7 @@
},
"bonusChallengeResult": {
"bsonType": "object",
- "required": [
- "bonusChallengeId",
- "completed"
- ],
+ "required": ["bonusChallengeId", "completed"],
"properties": {
"bonusChallengeId": {
"bsonType": "string"
@@ -359,9 +307,7 @@
},
"checkFocusResult": {
"bsonType": "object",
- "required": [
- "checkFocusId"
- ],
+ "required": ["checkFocusId"],
"properties": {
"checkFocusId": {
"bsonType": "string"
@@ -382,10 +328,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "name"
- ],
+ "required": ["_id", "name"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -407,10 +350,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "name"
- ],
+ "required": ["_id", "name"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -429,11 +369,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "teamId",
- "poolId"
- ],
+ "required": ["_id", "teamId", "poolId"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -455,12 +391,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "personId",
- "clusterId",
- "day"
- ],
+ "required": ["_id", "personId", "clusterId", "day"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -485,12 +416,7 @@
"validator": {
"$jsonSchema": {
"bsonType": "object",
- "required": [
- "_id",
- "date",
- "reports",
- "missing"
- ],
+ "required": ["_id", "date", "reports", "missing"],
"properties": {
"_id": {
"bsonType": "objectId"
@@ -508,4 +434,4 @@
}
}
}
-]
\ No newline at end of file
+]
diff --git a/backend/endpoints/hpcQuestion/controller/checkAnswer.js b/backend/endpoints/hpcQuestion/controller/checkAnswer.js
index d41761b..a6b9667 100644
--- a/backend/endpoints/hpcQuestion/controller/checkAnswer.js
+++ b/backend/endpoints/hpcQuestion/controller/checkAnswer.js
@@ -109,4 +109,4 @@ module.exports = (db) => {
});
}
};
-};
\ No newline at end of file
+};
diff --git a/backend/endpoints/hpcQuestion/controller/getRandomQuestion.js b/backend/endpoints/hpcQuestion/controller/getRandomQuestion.js
index 10b2502..dfa34da 100644
--- a/backend/endpoints/hpcQuestion/controller/getRandomQuestion.js
+++ b/backend/endpoints/hpcQuestion/controller/getRandomQuestion.js
@@ -9,8 +9,8 @@ module.exports = (db) => {
*/
return async (req, res) => {
try {
- if (Math.random() >= 0.35){
- return res.status(200).json ({
+ if (Math.random() >= 0.35) {
+ return res.status(200).json({
success: true,
body: null
});
@@ -18,10 +18,7 @@ module.exports = (db) => {
const [question] = await db
.collection('hpcQuestion')
- .aggregate([
- { $match: { active: true } },
- { $sample: { size: 1 } }
- ])
+ .aggregate([{ $match: { active: true } }, { $sample: { size: 1 } }])
.toArray();
if (!question) {
@@ -41,7 +38,9 @@ module.exports = (db) => {
optionOrder[randomIndex] = temporaryValue;
}
- const shuffledOptions = optionOrder.map((originalIndex) => question.options[originalIndex]);
+ const shuffledOptions = optionOrder.map(
+ (originalIndex) => question.options[originalIndex]
+ );
return res.status(200).json({
success: true,
@@ -59,4 +58,4 @@ module.exports = (db) => {
});
}
};
-};
\ No newline at end of file
+};
diff --git a/backend/endpoints/hpcQuestion/route.js b/backend/endpoints/hpcQuestion/route.js
index 7a8a3ff..937a1f5 100644
--- a/backend/endpoints/hpcQuestion/route.js
+++ b/backend/endpoints/hpcQuestion/route.js
@@ -5,4 +5,4 @@ module.exports = (db) =>
require('express')
.Router()
.get('/hpc-question/random', require('./controller/getRandomQuestion')(db))
- .post('/hpc-question/check', require('./controller/checkAnswer')(db))
\ No newline at end of file
+ .post('/hpc-question/check', require('./controller/checkAnswer')(db));
diff --git a/backend/scripts/data/hpcQuestion.js b/backend/scripts/data/hpcQuestion.js
index 0288be4..5fc746b 100644
--- a/backend/scripts/data/hpcQuestion.js
+++ b/backend/scripts/data/hpcQuestion.js
@@ -3,426 +3,405 @@ const { ObjectId } = require('mongodb');
const id = () => new ObjectId();
const hpcQuestions = [
- {
- _id: id(),
- question: 'What does squeue show?',
- options: [
- 'Jobs currently known to the scheduler',
- 'Available disk space',
- 'Loaded software modules',
- 'CPU temperature'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'squeue shows jobs in the scheduler queue, including jobs that are pending, running, or in other scheduler states.',
- active: true
- },
- {
- _id: id(),
- question: 'What is sinfo commonly used for?',
- options: [
- 'Checking Slurm partitions and node states',
- 'Viewing shell command history',
- 'Copying files between servers',
- 'Editing files'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'sinfo is commonly used to inspect Slurm partitions, node availability, and node states such as idle, allocated, mixed, or down.',
- active: true
- },
- {
- _id: id(),
- question: 'What command is commonly used to submit a Slurm job script?',
- options: [
- 'sbatch',
- 'squeue',
- 'scancel',
- 'sinfo'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'sbatch submits a batch job script to Slurm.',
- active: true
- },
- {
- _id: id(),
- question: 'What command is commonly used to view your current Slurm jobs?',
- options: [
- 'squeue -u $USER',
- 'chmod +x $USER',
- 'module load $USER',
- 'df -h $USER'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'squeue -u $USER shows jobs belonging to the current user.',
- active: true
- },
- {
- _id: id(),
- question: 'What does an array job in Slurm allow you to do?',
- options: [
- 'Run many similar tasks using one job submission',
- 'Store output in an array file format',
- 'Load multiple modules at the same time',
- 'Split one CPU core into multiple virtual cores'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'A Slurm array job lets you run many similar tasks from one submission, each with its own array task ID.',
- active: true
- },
- {
- _id: id(),
- question: 'What does %j commonly mean in a Slurm output filename?',
- options: [
- 'The Slurm job ID',
- 'The job name',
- 'The username',
- 'The node name'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'In Slurm output filename patterns, %j is commonly replaced with the job ID.',
- active: true
- },
- {
- _id: id(),
- question: 'What does module list usually show?',
- options: [
- 'Software modules currently loaded in your environment',
- 'All jobs currently running on the cluster',
- 'All files in the current directory',
- 'All available Slurm partitions'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'module list shows which software modules are currently loaded in your shell environment.',
- active: true
- },
- {
- _id: id(),
- question: 'What does module purge usually do?',
- options: [
- 'Removes loaded modules from the current environment',
- 'Deletes job output files',
- 'Cancels every pending job',
- 'Clears disk quota usage'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'module purge unloads currently loaded modules, giving you a cleaner environment.',
- active: true
- },
- {
- _id: id(),
- question: 'What does ls -la usually show?',
- options: [
- 'A detailed listing of files, including hidden files',
- 'Only running Slurm jobs',
- 'Only available modules',
- 'The current memory usage'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'ls -la lists files in long format and includes hidden files that begin with a dot.',
- active: true
- },
- {
- _id: id(),
- question: 'What does grep usually help with?',
- options: [
- 'Searching text for matching words or patterns',
- 'Submitting a batch job',
- 'Changing a file owner',
- 'Showing all partitions'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'grep searches text for matching words or patterns, which is useful when checking logs.',
- active: true
- },
- {
- _id: id(),
- question: 'What does tail -f usually do?',
- options: [
- 'Shows new lines added to a file as they appear',
- 'Deletes the end of a file',
- 'Shows only hidden files',
- 'Follows a Slurm partition'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'tail -f follows a file and displays new lines as they are written, which is useful for watching logs.',
- active: true
- },
- {
- _id: id(),
- question: 'What does cp source.txt copy.txt do?',
- options: [
- 'Copies source.txt to copy.txt',
- 'Moves source.txt into copy.txt',
- 'Deletes source.txt after creating copy.txt',
- 'Compares the two files'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'cp copies files or directories. In this example it creates copy.txt from source.txt.',
- active: true
- },
- {
- _id: id(),
- question: 'What does less file.txt help you do?',
- options: [
- 'View a file page by page',
- 'Make the file smaller',
- 'Delete lines from the file',
- 'Submit the file as a job'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'less lets you view text files page by page without loading everything into the terminal at once.',
- active: true
- },
- {
- _id: id(),
- question: 'What does df -h help check?',
- options: [
- 'Filesystem disk usage in a human-readable format',
- 'Loaded software modules',
- 'Current job queue',
- 'File permissions'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'df -h shows filesystem disk usage in human-readable units, which helps identify full or nearly full filesystems.',
- active: true
- },
- {
- _id: id(),
- question: 'In JavaScript, what does === check?',
- options: [
- 'Strict equality without type coercion',
- 'Assignment of a new value',
- 'Greater than or equal comparison',
- 'Loose equality with type conversion'
- ],
- correctAnswerIndex: 0,
- explanation:
- '=== checks strict equality. It compares both value and type without converting between types.',
- active: true
- },
- {
- _id: id(),
- question: 'What does JSON.stringify do?',
- options: [
- 'Converts a JavaScript value into a JSON string',
- 'Converts JSON text into a JavaScript object',
- 'Deletes empty JSON fields',
- 'Checks if JSON is valid without changing it'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'JSON.stringify converts JavaScript values such as objects or arrays into JSON text.',
- active: true
- },
- {
- _id: id(),
- question: 'What does JSON.parse do?',
- options: [
- 'Converts JSON text into a JavaScript value',
- 'Converts an object into JSON text',
- 'Deletes JSON from memory',
- 'Uploads JSON to a server'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'JSON.parse converts valid JSON text into a JavaScript value such as an object or array.',
- active: true
- },
- {
- _id: id(),
- question: 'In Express, what does res.status(404) usually mean?',
- options: [
- 'The requested resource was not found',
- 'The request succeeded',
- 'The server crashed',
- 'The user is not allowed to access the route'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'HTTP 404 means Not Found. It is used when the requested resource or route cannot be found.',
- active: true
- },
- {
- _id: id(),
- question: 'In Express, what does res.status(500) usually mean?',
- options: [
- 'An internal server error occurred',
- 'The client sent no body',
- 'The request succeeded',
- 'The user cancelled the request'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'HTTP 500 means Internal Server Error. It usually means something went wrong on the server.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does .each commonly do?',
- options: [
- 'Iterates over each item in a collection',
- 'Deletes each item in a collection',
- 'Sorts a collection automatically',
- 'Converts a collection into a string'
- ],
- correctAnswerIndex: 0,
- explanation:
- '.each loops through each item in a collection such as an array or hash.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does .map usually return?',
- options: [
- 'A new array containing the transformed values',
- 'The original array unchanged every time',
- 'Only the first matching value',
- 'A boolean true or false'
- ],
- correctAnswerIndex: 0,
- explanation:
- '.map transforms each item in a collection and returns a new array with the results.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does .select usually return?',
- options: [
- 'Items that match the condition',
- 'The first item only',
- 'The number of items in an array',
- 'The original string split into words'
- ],
- correctAnswerIndex: 0,
- explanation:
- '.select returns the items for which the block condition is truthy.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does .include? check?',
- options: [
- 'Whether a collection or string contains a value',
- 'Whether a method has been defined privately',
- 'Whether a file exists on disk',
- 'Whether a class has been inherited'
- ],
- correctAnswerIndex: 0,
- explanation:
- '.include? checks whether a value exists inside a collection or string and returns true or false.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does split usually do to a string?',
- options: [
- 'Breaks the string into an array of smaller strings',
- 'Joins an array into one string',
- 'Deletes the string',
- 'Converts the string into an integer automatically'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'split breaks a string into an array, usually using whitespace or a provided separator.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does join usually do?',
- options: [
- 'Combines array elements into one string',
- 'Splits a string into an array',
- 'Starts a new thread',
- 'Connects to a database automatically'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'join combines array elements into a single string, optionally using a separator.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does chomp usually remove?',
- options: [
- 'A trailing newline from a string',
- 'All spaces from a string',
- 'The first character from a string',
- 'All numbers from a string'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'chomp commonly removes a trailing newline from a string, which is useful when reading lines from files.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does File.readlines usually return?',
- options: [
- 'An array containing the lines of a file',
- 'A single boolean showing whether the file exists',
- 'The filename without its extension',
- 'The file permissions only'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'File.readlines reads a file and returns its lines as an array.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what is a symbol such as :name commonly used for?',
- options: [
- 'A lightweight identifier often used as a hash key',
- 'A string that automatically changes value',
- 'A hidden password field',
- 'A special type of integer'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'Symbols are lightweight identifiers. They are commonly used as hash keys and method names.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does attr_reader create?',
- options: [
- 'Getter methods for instance variables',
- 'Setter methods only',
- 'A new class automatically',
- 'A private constant'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'attr_reader creates getter methods so instance variables can be read from outside the object.',
- active: true
- },
- {
- _id: id(),
- question: 'In Ruby, what does a hash store?',
- options: [
- 'Key-value pairs',
- 'Only ordered numbers',
- 'Only one string value',
- 'Only method definitions'
- ],
- correctAnswerIndex: 0,
- explanation:
- 'A Ruby hash stores key-value pairs, similar to a dictionary or object map in other languages.',
- active: true
- }
+ {
+ _id: id(),
+ question: 'What does squeue show?',
+ options: [
+ 'Jobs currently known to the scheduler',
+ 'Available disk space',
+ 'Loaded software modules',
+ 'CPU temperature'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'squeue shows jobs in the scheduler queue, including jobs that are pending, running, or in other scheduler states.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What is sinfo commonly used for?',
+ options: [
+ 'Checking Slurm partitions and node states',
+ 'Viewing shell command history',
+ 'Copying files between servers',
+ 'Editing files'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'sinfo is commonly used to inspect Slurm partitions, node availability, and node states such as idle, allocated, mixed, or down.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What command is commonly used to submit a Slurm job script?',
+ options: ['sbatch', 'squeue', 'scancel', 'sinfo'],
+ correctAnswerIndex: 0,
+ explanation: 'sbatch submits a batch job script to Slurm.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What command is commonly used to view your current Slurm jobs?',
+ options: ['squeue -u $USER', 'chmod +x $USER', 'module load $USER', 'df -h $USER'],
+ correctAnswerIndex: 0,
+ explanation: 'squeue -u $USER shows jobs belonging to the current user.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does an array job in Slurm allow you to do?',
+ options: [
+ 'Run many similar tasks using one job submission',
+ 'Store output in an array file format',
+ 'Load multiple modules at the same time',
+ 'Split one CPU core into multiple virtual cores'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'A Slurm array job lets you run many similar tasks from one submission, each with its own array task ID.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does %j commonly mean in a Slurm output filename?',
+ options: ['The Slurm job ID', 'The job name', 'The username', 'The node name'],
+ correctAnswerIndex: 0,
+ explanation: 'In Slurm output filename patterns, %j is commonly replaced with the job ID.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does module list usually show?',
+ options: [
+ 'Software modules currently loaded in your environment',
+ 'All jobs currently running on the cluster',
+ 'All files in the current directory',
+ 'All available Slurm partitions'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'module list shows which software modules are currently loaded in your shell environment.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does module purge usually do?',
+ options: [
+ 'Removes loaded modules from the current environment',
+ 'Deletes job output files',
+ 'Cancels every pending job',
+ 'Clears disk quota usage'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'module purge unloads currently loaded modules, giving you a cleaner environment.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does ls -la usually show?',
+ options: [
+ 'A detailed listing of files, including hidden files',
+ 'Only running Slurm jobs',
+ 'Only available modules',
+ 'The current memory usage'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'ls -la lists files in long format and includes hidden files that begin with a dot.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does grep usually help with?',
+ options: [
+ 'Searching text for matching words or patterns',
+ 'Submitting a batch job',
+ 'Changing a file owner',
+ 'Showing all partitions'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'grep searches text for matching words or patterns, which is useful when checking logs.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does tail -f usually do?',
+ options: [
+ 'Shows new lines added to a file as they appear',
+ 'Deletes the end of a file',
+ 'Shows only hidden files',
+ 'Follows a Slurm partition'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'tail -f follows a file and displays new lines as they are written, which is useful for watching logs.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does cp source.txt copy.txt do?',
+ options: [
+ 'Copies source.txt to copy.txt',
+ 'Moves source.txt into copy.txt',
+ 'Deletes source.txt after creating copy.txt',
+ 'Compares the two files'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'cp copies files or directories. In this example it creates copy.txt from source.txt.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does less file.txt help you do?',
+ options: [
+ 'View a file page by page',
+ 'Make the file smaller',
+ 'Delete lines from the file',
+ 'Submit the file as a job'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'less lets you view text files page by page without loading everything into the terminal at once.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does df -h help check?',
+ options: [
+ 'Filesystem disk usage in a human-readable format',
+ 'Loaded software modules',
+ 'Current job queue',
+ 'File permissions'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'df -h shows filesystem disk usage in human-readable units, which helps identify full or nearly full filesystems.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In JavaScript, what does === check?',
+ options: [
+ 'Strict equality without type coercion',
+ 'Assignment of a new value',
+ 'Greater than or equal comparison',
+ 'Loose equality with type conversion'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ '=== checks strict equality. It compares both value and type without converting between types.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does JSON.stringify do?',
+ options: [
+ 'Converts a JavaScript value into a JSON string',
+ 'Converts JSON text into a JavaScript object',
+ 'Deletes empty JSON fields',
+ 'Checks if JSON is valid without changing it'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'JSON.stringify converts JavaScript values such as objects or arrays into JSON text.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'What does JSON.parse do?',
+ options: [
+ 'Converts JSON text into a JavaScript value',
+ 'Converts an object into JSON text',
+ 'Deletes JSON from memory',
+ 'Uploads JSON to a server'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'JSON.parse converts valid JSON text into a JavaScript value such as an object or array.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Express, what does res.status(404) usually mean?',
+ options: [
+ 'The requested resource was not found',
+ 'The request succeeded',
+ 'The server crashed',
+ 'The user is not allowed to access the route'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'HTTP 404 means Not Found. It is used when the requested resource or route cannot be found.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Express, what does res.status(500) usually mean?',
+ options: [
+ 'An internal server error occurred',
+ 'The client sent no body',
+ 'The request succeeded',
+ 'The user cancelled the request'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'HTTP 500 means Internal Server Error. It usually means something went wrong on the server.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does .each commonly do?',
+ options: [
+ 'Iterates over each item in a collection',
+ 'Deletes each item in a collection',
+ 'Sorts a collection automatically',
+ 'Converts a collection into a string'
+ ],
+ correctAnswerIndex: 0,
+ explanation: '.each loops through each item in a collection such as an array or hash.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does .map usually return?',
+ options: [
+ 'A new array containing the transformed values',
+ 'The original array unchanged every time',
+ 'Only the first matching value',
+ 'A boolean true or false'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ '.map transforms each item in a collection and returns a new array with the results.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does .select usually return?',
+ options: [
+ 'Items that match the condition',
+ 'The first item only',
+ 'The number of items in an array',
+ 'The original string split into words'
+ ],
+ correctAnswerIndex: 0,
+ explanation: '.select returns the items for which the block condition is truthy.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does .include? check?',
+ options: [
+ 'Whether a collection or string contains a value',
+ 'Whether a method has been defined privately',
+ 'Whether a file exists on disk',
+ 'Whether a class has been inherited'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ '.include? checks whether a value exists inside a collection or string and returns true or false.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does split usually do to a string?',
+ options: [
+ 'Breaks the string into an array of smaller strings',
+ 'Joins an array into one string',
+ 'Deletes the string',
+ 'Converts the string into an integer automatically'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'split breaks a string into an array, usually using whitespace or a provided separator.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does join usually do?',
+ options: [
+ 'Combines array elements into one string',
+ 'Splits a string into an array',
+ 'Starts a new thread',
+ 'Connects to a database automatically'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'join combines array elements into a single string, optionally using a separator.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does chomp usually remove?',
+ options: [
+ 'A trailing newline from a string',
+ 'All spaces from a string',
+ 'The first character from a string',
+ 'All numbers from a string'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'chomp commonly removes a trailing newline from a string, which is useful when reading lines from files.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does File.readlines usually return?',
+ options: [
+ 'An array containing the lines of a file',
+ 'A single boolean showing whether the file exists',
+ 'The filename without its extension',
+ 'The file permissions only'
+ ],
+ correctAnswerIndex: 0,
+ explanation: 'File.readlines reads a file and returns its lines as an array.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what is a symbol such as :name commonly used for?',
+ options: [
+ 'A lightweight identifier often used as a hash key',
+ 'A string that automatically changes value',
+ 'A hidden password field',
+ 'A special type of integer'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'Symbols are lightweight identifiers. They are commonly used as hash keys and method names.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does attr_reader create?',
+ options: [
+ 'Getter methods for instance variables',
+ 'Setter methods only',
+ 'A new class automatically',
+ 'A private constant'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'attr_reader creates getter methods so instance variables can be read from outside the object.',
+ active: true
+ },
+ {
+ _id: id(),
+ question: 'In Ruby, what does a hash store?',
+ options: [
+ 'Key-value pairs',
+ 'Only ordered numbers',
+ 'Only one string value',
+ 'Only method definitions'
+ ],
+ correctAnswerIndex: 0,
+ explanation:
+ 'A Ruby hash stores key-value pairs, similar to a dictionary or object map in other languages.',
+ active: true
+ }
];
-module.exports = hpcQuestions;
\ No newline at end of file
+module.exports = hpcQuestions;
diff --git a/backend/scripts/testData.js b/backend/scripts/testData.js
index 4060ba3..c8be15a 100644
--- a/backend/scripts/testData.js
+++ b/backend/scripts/testData.js
@@ -11,8 +11,6 @@ module.exports.seedData = async (db) => {
const methodCol = db.collection('method');
const bonusChallengeCol = db.collection('bonusChallenge');
-
-
const hpcQuestionCol = db.collection('hpcQuestion');
const checkFocusCol = db.collection('checkFocus');
@@ -235,13 +233,11 @@ module.exports.seedData = async (db) => {
await bonusChallengeCol.insertMany(bonusChallenges);
-
-
// -----------------------------
// HPC QUICK CHECK QUESTIONS
// -----------------------------
await hpcQuestionCol.insertMany(hpcQuestions);
-
+
// -----------------------------
// CHECKING OPERATIONAL FOCUS OF THE CHECK
// E.G. GRUMPY OLD RESEARCHER
diff --git a/frontend/app/components/Form.jsx b/frontend/app/components/Form.jsx
index 282f79a..c40f84e 100644
--- a/frontend/app/components/Form.jsx
+++ b/frontend/app/components/Form.jsx
@@ -312,7 +312,6 @@ export default function Form() {
getHpcQuestion();
}, []);
-
async function checkHpcAnswer(answerIndex) {
if (!hpcQuestion || hpcQuestionResult) return;
@@ -364,7 +363,6 @@ export default function Form() {
getCheckFocus();
}, []);
-
function toggleStep(stepId) {
setCompletedSteps((prev) => ({
...prev,
@@ -413,16 +411,16 @@ export default function Form() {
bonusChallengeResult:
bonusChallenge && bonusCompleted
? {
- bonusChallengeId: bonusChallenge.id,
- completed: bonusCompleted
- }
+ bonusChallengeId: bonusChallenge.id,
+ completed: bonusCompleted
+ }
: null,
checkFocusResult: checkFocus
? {
- checkFocusId: checkFocus.id,
- reflection: focusReflection.trim()
- }
+ checkFocusId: checkFocus.id,
+ reflection: focusReflection.trim()
+ }
: null
};
@@ -618,7 +616,9 @@ export default function Form() {