Learn Environment
task.hpp
Go to the documentation of this file.
1 #ifndef TASK_HPP
2 #define TASK_HPP
3 
4 #include <QString>
5 #include <QVector>
6 #include <QSharedPointer>
7 #include <QWeakPointer>
8 
9 // Forward declaration of Task struct
10 struct Task;
11 
16 enum class SubtaskStatus {
17  Inactive,
18  Ready,
19  Queued,
20  Running
21 };
22 
31 struct Subtask {
32  QString title;
33  QString description;
34  QString file;
35  QString filePath;
36  QString solutionFilePath;
38 
39  // optional field
40  int timeoutSeconds = 60;
43 
44  // internal fields
45  QWeakPointer<Task> parentTask;
47 
48  bool hasBeenExecuted = false;
49  bool lastExecutionFailed = false;
51 };
52 
61 struct Task {
62  QString title;
63  QString folder;
64  QString difficulty;
65  QString topic;
66  QVector<Subtask> subtasks;
67 
68  // optional field
69  bool previousSubtasksRequired = false;
70 
71  // internal fields
73 };
74 
75 #endif // TASK_HPP
Task::folder
QString folder
The folder path of the task.
Definition: task.hpp:63
Subtask::evaluationFilePath
QString evaluationFilePath
The file path to the evaluation script of the subtask.
Definition: task.hpp:37
Task::topic
QString topic
The topic of the task.
Definition: task.hpp:65
Subtask::file
QString file
The file name of the subtask.
Definition: task.hpp:34
Subtask::status
SubtaskStatus status
The status of the subtask.
Definition: task.hpp:46
SubtaskStatus::Queued
@ Queued
The subtask is queued for execution.
Subtask::lastExecutionError
QString lastExecutionError
The error message from the last execution of the subtask.
Definition: task.hpp:50
SubtaskStatus::Running
@ Running
The subtask is currently being executed.
SubtaskStatus
SubtaskStatus
Represents the status of a subtask.
Definition: task.hpp:16
Task::difficultyHexColor
QString difficultyHexColor
The hex color associated with the difficulty level.
Definition: task.hpp:72
Subtask::timeoutSeconds
int timeoutSeconds
The timeout for the subtask execution in seconds.
Definition: task.hpp:40
Subtask::lastExecutionFailed
bool lastExecutionFailed
Whether the subtask has been executed at least once.
Definition: task.hpp:49
Subtask::solutionFilePath
QString solutionFilePath
The file path to the solution of the subtask.
Definition: task.hpp:36
Subtask::description
QString description
The description of the subtask.
Definition: task.hpp:33
SubtaskStatus::Inactive
@ Inactive
The subtask is inactive (state where it can't be executed).
Subtask::title
QString title
The title of the subtask.
Definition: task.hpp:32
Task::title
QString title
The title of the task.
Definition: task.hpp:62
Task::previousSubtasksRequired
bool previousSubtasksRequired
Whether previous subtasks are required.
Definition: task.hpp:69
Subtask::parentTask
QWeakPointer< Task > parentTask
Weak pointer to the parent task.
Definition: task.hpp:45
Subtask::filePath
QString filePath
The file path of the subtask.
Definition: task.hpp:35
Task::subtasks
QVector< Subtask > subtasks
The list of subtasks within the task.
Definition: task.hpp:66
Subtask::hasBeenExecuted
bool hasBeenExecuted
Whether the subtask has been executed at least once.
Definition: task.hpp:48
Subtask::reset_robot_before_executing
bool reset_robot_before_executing
Whether to reset the robot before executing the subtask.
Definition: task.hpp:42
SubtaskStatus::Ready
@ Ready
The subtask is ready to be executed.
Subtask::parallelizedEvaluationRequired
bool parallelizedEvaluationRequired
Whether parallelized evaluation is required.
Definition: task.hpp:41
Task
Represents a task containing multiple subtasks.
Definition: task.hpp:61
Subtask
Represents a subtask within a task.
Definition: task.hpp:31
Task::difficulty
QString difficulty
The difficulty level of the task.
Definition: task.hpp:64