Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkShortAnswerQuestion.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkShortAnswerQuestion_h
14 #define mitkShortAnswerQuestion_h
15 
16 #include <mitkTextQuestion.h>
17 
18 namespace mitk::Forms
19 {
28  {
29  public:
33 
38  std::string GetType() const override;
39 
44  Question* CreateAnother() const override;
45 
50  void FromJSON(const nlohmann::ordered_json& j) override;
51 
56  void ToJSON(nlohmann::ordered_json& j) const override;
57  };
58 
66  MITKFORMS_EXPORT void from_json(const nlohmann::ordered_json& j, ShortAnswerQuestion& q);
67 
75  MITKFORMS_EXPORT void to_json(nlohmann::ordered_json& j, const ShortAnswerQuestion& q);
76 }
77 
78 #endif
#define MITKFORMS_EXPORT
Abstract base class for all types of questions used in a Form.
Definition: mitkQuestion.h:38
A Question whose possible response is a short single-line free text.
std::string GetType() const override
Return the type string "Short answer".
~ShortAnswerQuestion() override
Virtual destructor.
void FromJSON(const nlohmann::ordered_json &j) override
Deserialize this ShortAnswerQuestion from JSON.
void ToJSON(nlohmann::ordered_json &j) const override
Serialize this ShortAnswerQuestion to JSON.
Question * CreateAnother() const override
Create a new default-constructed ShortAnswerQuestion instance.
Abstract base class for questions with a single free-text response.
MITKFORMS_EXPORT void to_json(nlohmann::ordered_json &j, const CheckboxesQuestion &q)
Serialize a CheckboxesQuestion to JSON.
MITKFORMS_EXPORT void from_json(const nlohmann::ordered_json &j, CheckboxesQuestion &q)
Deserialize a CheckboxesQuestion from JSON.