Changeset 75 for Dev/trunk/dashboard.php


Ignore:
Timestamp:
08/08/11 15:12:46 (14 years ago)
Author:
fpvanagthoven
Message:

Application should now just be RDF-saved. Beginning on DashboardTool?.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/dashboard.php

    r73 r75  
    33
    44if (is_null($_SESSION['username']))
    5     redirect('index.php');
     5        redirect('index.php');
     6
     7/* MOCK SURVEY */
     8
     9$survey = new Survey('ultimateid', 'The Epic Survey');
     10$question1 = new Question('question1id', 'Age', 'int', 'What is your age?');
     11$question2 = new Question('question2id', 'Identity', 'mc', 'Are you freakazoid?');
     12$question2->answers = array('yes', 'no', 'maybe');
     13
     14$survey->addQuestion($question1);
     15$survey->addQuestion($question2);
     16
     17/* MOCK RESULTS */
     18
     19
     20$survey1Results = new SurveyResults();
     21
     22$question1Answers = array(3, 5, 12, 134, 5, 40); // int
     23$question2Answers = array('yes', 'no', 'no', 'yes', 'maybe', 'no');     // Multiple choice
     24
     25$question1Result = new QuestionResult(ResultType::INTEGER, $question1Answers);
     26$question2Result = new QuestionResult(ResultType::MULTIPLE_CHOICE, $question2Answers);
     27
     28$survey1Results->addQuestionResult($question1Result);
     29$survey1Results->addQuestionResult($question2Result);
     30
     31/*  COMBINE */
     32
     33$survey->setResults($survey1Results);
     34
     35$surveys = array($survey);
     36
    637?>
    738<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     
    1243        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    1344            <title></title>
    14             <?php new StyleSheet(); ?>
     45                        <?php new StyleSheet(); ?>
     46                        <script type="text/javascript" src="d3/d3.js"></script>
    1547    </head>
    1648    <body>
    1749        <div id="header">
    18             <?php new Logo(); ?>
     50                        <?php new Logo(); ?>
    1951        </div>
    2052        <div id="wrapper">
    2153
    2254            <div id="content">
    23                 <?php
    24                 ?>
     55                                <?php new DashboardTool($surveys); ?>
    2556            </div>
    2657        </div>
Note: See TracChangeset for help on using the changeset viewer.