PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
Chain.cpp File Reference
#include "Chain.h"
#include "Study.h"
#include "../../libs/json.hpp"
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <sys/stat.h>

Go to the source code of this file.

Typedefs

using json = nlohmann::json
 

Functions

std::string ItemTypeToString (ItemType type)
 
ItemType StringToItemType (const std::string &str)
 

Typedef Documentation

◆ json

using json = nlohmann::json

Definition at line 14 of file Chain.cpp.

Function Documentation

◆ ItemTypeToString()

std::string ItemTypeToString ( ItemType  type)

Definition at line 20 of file Chain.cpp.

20 {
21 switch (type) {
23 return "instruction";
25 return "consent";
27 return "completion";
28 case ItemType::Test:
29 return "test";
30 default:
31 return "unknown";
32 }
33}

References Completion, Consent, Instruction, and Test.

Referenced by ChainItem::CreateChainPageConfig(), and ChainItem::GetDisplayName().

◆ StringToItemType()

ItemType StringToItemType ( const std::string &  str)

Definition at line 35 of file Chain.cpp.

35 {
36 if (str == "instruction") return ItemType::Instruction;
37 if (str == "consent") return ItemType::Consent;
38 if (str == "completion") return ItemType::Completion;
39 if (str == "test") return ItemType::Test;
40 return ItemType::Instruction; // Default fallback
41}

References Completion, Consent, Instruction, and Test.