Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (47 sloc) 2.48 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TheFragebogen: dynamic questionnaire</title>
<link rel="stylesheet" type="text/css" href="example.css">
<script src="../thefragebogen.js"></script>
<script>
var screenController = new ScreenController(
new ScreenUIElements(
new UIElementHTML(undefined, "<h1>TheFragebogen</h1>"),
new UIElementHTML(undefined, "This demo shows you how to create 'dynamic' or so-called responsive questionnaires."),
new UIElementHTML(undefined, "Each time pressing 'Next' a new ScreenUIElements is created, which shows the time at which the previous screen was started."),
new UIElementHTML(undefined, "This questionnaire does not end and will always look the same."),
new QuestionnaireItemSystemScreenDateTime())
);
</script>
<script>
function start() {
document.body.innerHTML += "TheFragebogen loaded.";
if (typeof(screenController) === "undefined") {
document.body.innerHTML += "<br><i>Something went wrong:</i> Please check that thefragebogen.js was loaded and that the configuration is ok.";
return;
}
screenController.init(document.body);
screenController.setCallbackScreenFinished(function() {
screenController.getCurrentScreenIndex();
var nextIndex = screenController.addScreen(new ScreenUIElements(
new UIElementHTML(undefined, "<h1>TheFragebogen</h1>"),
new UIElementHTML(undefined, "This demo shows you how to create 'dynamic' or so-called responsive questionnaires."),
new UIElementHTML(undefined, "Each time pressing 'Next' a new ScreenUIElements is created, which shows the time at which the previous screen was started."),
new UIElementHTML(undefined, "" + screenController.getCurrentScreen().uiElements[4].getAnswer()),
new QuestionnaireItemSystemScreenDateTime()
));
screenController.goToScreenAbsolute(nextIndex);
return false;
});
screenController.start();
}
</script>
</head>
<body onload="start()">
<p>
TheFragebogen will be shown here.<br> If something fails while starting, an error message will be shown here.
</p>
</body>
</html>
You can’t perform that action at this time.