ChoiceTask
#include "Tutorial/Tutorial.h"
Inherits from TestQuestion, TutorialElement
Public Functions
| Name | |
|---|---|
| ChoiceTask(std::string question, std::vector< std::string > choices, int correctChoice) | |
| virtual void | acceptRenderer(ITutorialRenderer * tutorialRenderer) override |
| virtual void | onSubmit() override<br>Set m_isCorrect based on the answer. |
Public Attributes
| Name | |
|---|---|
| std::vector< std::string > | m_choices |
| int | m_correctChoice |
| int | m_selected |
Additional inherited members
Public Functions inherited from TestQuestion
| Name | |
|---|---|
| TestQuestion(std::string question) | |
| void | submit() |
Public Attributes inherited from TestQuestion
| Name | |
|---|---|
| bool | m_isCorrect |
| bool | m_isSubmitted |
Public Functions inherited from TutorialElement
| Name | |
|---|---|
| TutorialElement() | |
| TutorialElement(std::string content) | |
| virtual | ~TutorialElement() =default |
Public Attributes inherited from TutorialElement
| Name | |
|---|---|
| std::string | m_content |
Public Functions Documentation
function ChoiceTask
cpp
inline ChoiceTask(
std::string question,
std::vector< std::string > choices,
int correctChoice
)inline ChoiceTask(
std::string question,
std::vector< std::string > choices,
int correctChoice
)function acceptRenderer
cpp
inline virtual void acceptRenderer(
ITutorialRenderer * tutorialRenderer
) overrideinline virtual void acceptRenderer(
ITutorialRenderer * tutorialRenderer
) overrideReimplements: TutorialElement::acceptRenderer
function onSubmit
cpp
inline virtual void onSubmit() overrideinline virtual void onSubmit() overrideSet m_isCorrect based on the answer.
Reimplements: TestQuestion::onSubmit
Public Attributes Documentation
variable m_choices
cpp
std::vector< std::string > m_choices;std::vector< std::string > m_choices;variable m_correctChoice
cpp
int m_correctChoice;int m_correctChoice;variable m_selected
cpp
int m_selected = -1;int m_selected = -1;Updated on 2025-09-07 at 16:13:50 +0000