Skip to content

InputTask

#include "Tutorial/Tutorial.h"

Inherits from TestQuestion, TutorialElement

Public Functions

Name
InputTask(std::string question, std::unordered_set< std::string > correctAnswers)
virtual voidacceptRenderer(ITutorialRenderer * tutorialRenderer) override
virtual voidonSubmit() override<br>Set m_isCorrect based on the answer.

Public Attributes

Name
std::unordered_set< std::string >m_correctAnswers
std::array< char, 64 >m_input

Additional inherited members

Public Functions inherited from TestQuestion

Name
TestQuestion(std::string question)
voidsubmit()

Public Attributes inherited from TestQuestion

Name
boolm_isCorrect
boolm_isSubmitted

Public Functions inherited from TutorialElement

Name
TutorialElement()
TutorialElement(std::string content)
virtual~TutorialElement() =default

Public Attributes inherited from TutorialElement

Name
std::stringm_content

Public Functions Documentation

function InputTask

cpp
inline InputTask(
    std::string question,
    std::unordered_set< std::string > correctAnswers
)
inline InputTask(
    std::string question,
    std::unordered_set< std::string > correctAnswers
)

function acceptRenderer

cpp
inline virtual void acceptRenderer(
    ITutorialRenderer * tutorialRenderer
) override
inline virtual void acceptRenderer(
    ITutorialRenderer * tutorialRenderer
) override

Reimplements: TutorialElement::acceptRenderer

function onSubmit

cpp
inline virtual void onSubmit() override
inline virtual void onSubmit() override

Set m_isCorrect based on the answer.

Reimplements: TestQuestion::onSubmit

Public Attributes Documentation

variable m_correctAnswers

cpp
std::unordered_set< std::string > m_correctAnswers;
std::unordered_set< std::string > m_correctAnswers;

variable m_input

cpp
std::array< char, 64 > m_input = {0};
std::array< char, 64 > m_input = {0};

Updated on 2025-01-07 at 13:40:43 +0000