Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkMultipleChoiceQuestion.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 mitkMultipleChoiceQuestion_h
14 #define mitkMultipleChoiceQuestion_h
15 
17 
18 namespace mitk::Forms
19 {
27  {
28  public:
32 
37  std::string GetType() const override;
38 
43  Question* CreateAnother() const override;
44 
49  void FromJSON(const nlohmann::ordered_json& j) override;
50 
55  void ToJSON(nlohmann::ordered_json& j) const override;
56 
62 
68  };
69 
77  MITKFORMS_EXPORT void from_json(const nlohmann::ordered_json& j, MultipleChoiceQuestion& q);
78 
86  MITKFORMS_EXPORT void to_json(nlohmann::ordered_json& j, const MultipleChoiceQuestion& q);
87 }
88 
89 #endif
#define MITKFORMS_EXPORT
A Question whose possible responses are represented by radio buttons.
void FromJSON(const nlohmann::ordered_json &j) override
Deserialize this MultipleChoiceQuestion from JSON.
std::string GetType() const override
Return the type string "Multiple choice".
void ToJSON(nlohmann::ordered_json &j) const override
Serialize this MultipleChoiceQuestion to JSON.
~MultipleChoiceQuestion() override
Virtual destructor.
Question * CreateAnother() const override
Create a new default-constructed MultipleChoiceQuestion instance.
virtual void SetResponse(size_t i)
Set one of the possible answer options as the single response.
Base class for questions with options that may also have a free text option.
void SetOtherResponse(const std::string &response)
Set the "Other" response as single exclusive response to this question.
Abstract base class for all types of questions used in a Form.
Definition: mitkQuestion.h:38
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.