Ignore:
Timestamp:
01/13/12 13:57:41 (13 years ago)
Author:
fpvanagthoven
Message:
 
Location:
Dev/branches/jos-branch
Files:
34 added
11 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/jos-branch/classes/models/Question.php

    r217 r233  
    1212        private static $filename = 'data/questions/questions.rdf';
    1313
     14    public $code;
    1415    public $title;
    1516    public $type;
     
    2728     * @param type $answers
    2829     */
    29     public function __construct($uid, $title = null, $type = null, $description = null, $category = null, $answers = null)
     30    public function __construct($uid, $code = null, $title = null, $type = null, $description = null, $category = null, $answers = null)
    3031    {
    3132                if(!isset($uid))
     
    3334                        $uid = md5(uniqid(rand(), true));
    3435                }
     36        $this->code = $code;
    3537        $this->uid = $uid;
    3638        $this->title = $title;
     
    6163        $predicateRType = new Resource(RTYPE);
    6264        $model->add(new Statement($resourceQuestion,$predicateRType,$resourceQuestionType));
     65       
     66        $questionUid = new Literal($this->uid);
     67        $predicateUid = new Resource(UID);
     68        $model->add(new Statement($resourceQuestion,$predicateUid,$questionUid));
    6369       
    6470        $questionQCode = new Literal($this->uid);
     
    98104     * Get the questions corresponding to the arguments.
    99105         * @param type $arguments : An array having one ore more of the following elements:
    100          * 'code', 'title', 'type', 'description', 'category', 'definedanswers'.
     106         * 'uid', 'code', 'title', 'type', 'description', 'category', 'definedanswers'.
    101107     */
    102108    public static function get($arguments)
     
    107113            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
    108114            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
    109             SELECT DISTINCT ?uid, ?title, ?type, ?description, ?category
     115            SELECT DISTINCT ?uid, ?code, ?title, ?type, ?description, ?category
    110116            WHERE       
    111117            {
    112118                _question       predicates:resource_type        resources:question ;               
    113                 predicates:question_code ?uid ;
     119                predicates:uid ?uid ;
     120                predicates:question_code ?code ;
    114121                predicates:title ?title ;
    115122                predicates:question_type ?type ;
     
    130137            {
    131138                                $answers = Question::getAnswers($model, $result['?uid']->label);
    132                 $questions[] = new Question($result['?uid']->label, $result['?title']->label, $result['?type']->label, $result['?description']->label, $result['?category']->label, $answers);
     139                $questions[] = new Question($result['?uid']->label, $result['?code']->label, $result['?title']->label, $result['?type']->label, $result['?description']->label, $result['?category']->label, $answers);
    133140            }
    134141        }
  • Dev/branches/jos-branch/classes/models/ResearchToolObject.php

    r212 r233  
    55 * @author jkraaijeveld
    66 */
     7// Survey database interface class as intermediate for storing data from the site to the RDF database
     8require_once 'rdfConstants.php';
     9// Include RAP Library to write RDF files
     10include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
     11
     12
    713abstract class ResearchToolObject {
    814
  • Dev/branches/jos-branch/classes/widgets/SurveyEditorWidget.php

    r230 r233  
    1313
    1414    private $loadedSurvey;
    15     private $dbi;
    1615
    1716    public function __construct() {
    18         // Set basic variables
    19         // Should probably include a default empty survey for the sake of safety
    20         $dbi = new DatabaseInterface();
     17       
    2118    }
    2219
    2320    public function handlePost() {
    2421        // Get POSTed data and store variables to class instance properties
    25         $dbi = new DatabaseInterface();
     22       
    2623        if (isset($_POST['objectUid']) && !empty($_POST['objectUid'])) {
    27             $surveyResults = $dbi->get("Survey", array("uid" => $_POST['objectUid']));
     24            $surveyResults = Survey::get(array("uid" => $_POST['objectUid']));
    2825            if (!empty($surveyResults)) {
    2926                $this->loadedSurvey = $surveyResults[0];
     
    3936        $questionString = "";
    4037        foreach ($this->loadedSurvey->questions as $question) {
    41             $questionString .= $question->code . ",";
     38            $questionString .= $question->uid . ",";
    4239        }
    4340        // echo the HTML markup to display the editor on the screen
  • Dev/branches/jos-branch/classes/widgets/Toolbox.php

    r230 r233  
    2525                        <div class="bigButton toolbox" onclick="ddMenu.Open('toolbox_m1')"><img src="images/icons/survey.png" class="buttonIcon" /><p>Survey</p>
    2626                            <div id="toolbox_m1" onmouseover="ddMenu.CancelCloseTimer()" onmouseout="ddMenu.SetCloseTimer()">
    27                                 <a href="#" >+ Add new</a>
     27                                <a href="#" onclick="submitToolbox('Survey')">+ Add new</a>
    2828                                <a href="#">> Add existing</a>
    2929                            </div>
     
    3434                        <div class="bigButton toolbox" onClick="ddMenu.Open('toolbox_m2')"><img src="images/icons/application.png" class="buttonIcon" /><p>Application</p>
    3535                            <div id="toolbox_m2" onmouseover="ddMenu.CancelCloseTimer()" onmouseout="ddMenu.SetCloseTimer()">
    36                                 <a href="#">+ Add new</a>
     36                                <a href="#" onclick="submitToolbox('Application')">+ Add new</a>
    3737                                <a href="#">> Add existing</a>
    3838                            </div>
  • Dev/branches/jos-branch/createObject.php

    r208 r233  
    1313}
    1414
    15 $dbi = new DatabaseInterface();
    16 $creator_results = $dbi->get("User", array("uid" => $_SESSION['userUid']));
     15
     16$creator_results = User::get(array("uid" => $_SESSION['userUid']));
    1717$creator = $creator_results[0];
    1818
     
    2727    case "application":
    2828        $newApp = new Application(null, "New application", "Default description", "Default style");
    29         $dbi->set($newApp);
     29        $newApp->save();
    3030        $uid = $newApp->uid;
    3131        break;
    3232    case "survey":
    3333        $newSurvey = new Survey(null, "New Survey", "Default description", $creator, null);
    34         $dbi->set($newSurvey);
     34        $newSurvey->save();
    3535        $uid = $newSurvey->uid;
    3636        break;
     
    3939        break;
    4040    case "question":
    41         $newQuestion = new Question(null, "new Question", "int", "Default description", "Standard category", array());
    42         $dbi->set($newQuestion);
     41        $newQuestion = new Question(null, "QCode", "new Question", "int", "Default description", "Standard category", array());
     42        $newQuestion->save();
    4343        $uid = $newQuestion->uid;
    4444        break;
  • Dev/branches/jos-branch/css/awesome.css

    r112 r233  
    3232}
    3333
    34 label {
    35     font-size: small;
    36     font-weight: bold;
    37     color: #333;
    38     text-shadow: #fff 0px 0px 1px;
    39 }
    40 
    4134legend {
    4235    padding-left: 0em;
     
    4841    background-color: #aeb2b3;
    4942    border: 1px solid #fff;
    50     -moz-border-radius: 15px;
    51     border-radius: 15px;
     43    -moz-border-radius: 1em;
     44    border-radius: 1em;
    5245    margin-bottom: 2em;
    5346    padding: 0 1em 1em 1em;
     
    5952    background-image: url('../images/bg/blueishgridblock.png');
    6053    height: 100%;
     54    font-size: 12px;
    6155}
    6256
     
    107101    font-weight: bold;
    108102    text-align: center;
    109     line-height: 2em;
     103    padding-top: 15px;
     104    /*line-height: 2em;*/
    110105    text-shadow: #555 0px 0px .2em;
    111106    height: 189px;
     
    259254    -moz-border-radius: 6px;
    260255    border-radius: 6px;
     256}
     257
     258
     259.surveyButton.dis {
     260    color: #666;
     261}
     262
     263.surveyButton.dis:hover {
     264    background-color: transparent;
     265    color: #666;
     266    border-color: #555;
    261267}
    262268
     
    549555
    550556#questionEditForm {
    551    
     557
    552558}
    553559
     
    557563    color:white;
    558564}
     565
     566
     567/*
     568#pipelineFrame{
     569    height: 12em;
     570    width: 96em;
     571    display: block;
     572    background-image: url('../images/bg/pipelineFrameBG.png');
     573    background-color: #e3eff3;
     574}
     575
     576.pipelineFrame .pipelineObject {
     577    width: 10em;
     578    height: 10em;
     579    margin: 1em auto 1em auto;
     580    text-align: center;
     581}
     582*/
     583
     584/*
     585*
     586*
     587*   Horizontal sequencer styling
     588*
     589*
     590*/
     591
     592#sequencer {
     593    width: 100%;
     594    /*max-width: 800px;*/
     595    margin: 0 auto 0 auto;
     596    padding-right: 0.5em;
     597    /*background-image: url('../images/bg/sequencerBG.png');*/
     598    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     599    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     600    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     601    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     602    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     603
     604    background-image: -webkit-gradient(
     605        linear,
     606        left top,
     607        left bottom,
     608        color-stop(0.21, #B0B0B0),
     609        color-stop(0.8, #888888)
     610        );
     611    background-position: bottom;
     612    background-repeat: repeat-x;
     613    float: left;
     614}
     615
     616#sequencer #seqContent {
     617    height: 9em;
     618    width: 98%;
     619    overflow-x: scroll;
     620    overflow-y: hidden;
     621
     622    margin-bottom: 0.5em;
     623
     624    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     625    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     626    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     627    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     628    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     629    background-image: -webkit-gradient(
     630        linear,
     631        left bottom,
     632        left top,
     633        color-stop(0.25, #B0B0B0),
     634        color-stop(0.8, #888888)
     635        );
     636
     637    border: 1px solid #ddd;
     638    -moz-border-radius: 0.5em;
     639    border-radius: 0.5em;
     640    padding: 0.5em;
     641    /*white-space: nowrap;*/
     642    float: left;
     643}
     644
     645#sequencer #controls {
     646    width: auto;
     647    text-align: right;
     648    margin-bottom: -0.5em;
     649    float: right;
     650}
     651
     652.displayStep {
     653    width: 52px;
     654    padding: 0;
     655    margin: 10px 0 0 0;
     656    background-repeat: no-repeat;
     657    float: left;
     658    text-align: center;
     659    -webkit-user-select: none;
     660    -khtml-user-select: none;
     661    -moz-user-select: none;
     662    -o-user-select: none;
     663    user-select: none;
     664}
     665
     666.displayStep.selected {
     667    -moz-box-shadow: 0 0 50px #FFF;
     668    -webkit-box-shadow: 0 0 50px #FFF;
     669    box-shadow: 0 0 50px #FFF;
     670
     671}
     672
     673.displayStep .displayStepIcon {
     674    width: 50px;
     675    height: 50px;
     676    border: 2px solid #444444;
     677    color: #FFF;
     678    /*float: left;*/
     679}
     680
     681.displayStep p{
     682    margin-top: 5px;
     683    font-weight: normal;
     684    font-size: 0.875em;
     685    /*float: left;*/
     686
     687}
     688
     689#seqContent .divider {
     690    width: 10px;
     691    height: 50px;
     692    margin: 10px 15px 0 20px;
     693    background-image: url('../images/ui/sequencerDivider.png');
     694    float: left;
     695    /*display: inline-block;*/
     696}
     697
     698#seqContentWrapper {
     699    float: left;
     700    margin-right: -32767px; /* maximum for opera, enough for ~320 steps*/
     701    padding: 0 10px;
     702}
     703
     704
     705
     706
     707
     708
     709/*
     710 *
     711 *
     712 *  TOOLBOX
     713 *
     714 *
     715*/
     716
     717#toolbox {
     718    /*width: 40%;*/
     719    float: left;
     720    margin: 1em 2em 0 0;
     721    /*background-image: url('../images/bg/sequencerBG.png');*/
     722    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     723    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     724    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     725    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     726    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     727
     728    background-image: -webkit-gradient(
     729        linear,
     730        left top,
     731        left bottom,
     732        color-stop(0.25, #B0B0B0),
     733        color-stop(0.8, #888888)
     734        );
     735
     736}
     737
     738#toolbox .creationButton {
     739    height: 50px;
     740    margin: 0 0 5px 0;
     741    border: 1px solid #000;
     742    border-radius: 6px;
     743    -moz-border-radius: 6px;
     744    cursor: pointer;
     745}
     746
     747#toolbox .creationButton:hover {
     748    border: 1px solid #FFF;
     749    background: rgba(255, 255, 255, 0.2);
     750}
     751
     752#toolbox .buttonIcon {
     753    border: none;
     754    border-radius: 6px;
     755    margin: 0 10px 0 0;
     756    float: left;
     757}
     758
     759#toolbox .creationButton p {
     760    margin: 15px 10px 0 0;
     761    color: #444;
     762    float: left;
     763}
     764
     765#infoPanel {
     766    width: 500px;
     767    float: right;
     768    margin: 1em 0 0 0;
     769    /*background-image: url('../images/bg/sequencerBG.png');*/
     770    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     771    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     772    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     773    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     774    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     775
     776    background-image: -webkit-gradient(
     777        linear,
     778        left top,
     779        left bottom,
     780        color-stop(0.25, #B0B0B0),
     781        color-stop(0.8, #888888)
     782        );
     783}
     784
     785#infoContent {
     786    float: left;
     787    display: block;
     788    width: 500px;
     789    background-color: #ff0000;
     790}
     791
     792.fieldsetTitle {
     793    height: 1em;
     794    margin-bottom: 0.5em;
     795    margin-top:0.5em;
     796    margin-left: 1em;
     797    font-size: 1.25em;
     798    color: #FFF;
     799    /*float: left;*/
     800    display: block;
     801    clear: right;
     802}
     803
     804fieldset p {
     805    display: block;
     806}
     807
     808
     809
     810/* QUESTION EDITOR
     811*/
     812
     813#questionEditor {
     814    width: 60em;
     815    background-color: #00FF00;
     816    border: 1px solid #FFF;
     817    display: block;
     818    margin: 0;
     819    padding: 0;
     820    float: left;
     821    background-color: #5c5c5c;
     822    -moz-box-shadow: 2px 2px 1px #888;
     823    -webkit-box-shadow: 2px 2px 1px #888;
     824    box-shadow: 2px 2px 1px #888;
     825}
     826
     827#questionEditor_header {
     828    height: 1.5em;
     829    float: left;
     830    font-size: 1.25em;
     831    color: #FFF;
     832    padding: 0.5em 1em 0 1em;
     833}
     834
     835#questionEditor_content {
     836    width: 58em;
     837    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     838    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     839    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     840    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     841    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     842    background-image: -webkit-gradient(
     843        linear,
     844        left top,
     845        left bottom,
     846        color-stop(0.21, #B0B0B0),
     847        color-stop(0.8, #888888)
     848        );
     849    background-position: bottom;
     850    background-repeat: repeat-x;
     851    float: left;
     852    padding: 0.5em 1em;
     853
     854}
     855
     856#questionEditor_controls {
     857    float: right;
     858    height: 2em;
     859    text-align: right;
     860}
     861
     862
     863
     864#questionEditor_bodyText_textArea {
     865    resize: none;
     866    width: auto;
     867    min-width: 51em;
     868    margin: 3px;
     869}
     870
     871#questionEditor_bodyText_staticText {
     872    color: white;
     873    font-size: 12px;
     874}
     875
     876.questionParamField {
     877    float: left;
     878    margin: 2px 0 2px 0;
     879}
     880
     881#questionEditor_questionParams label {
     882    width: 130px;
     883    float: left;
     884    margin: 4px 0 0 0;
     885}
     886
     887.formLineBreak {
     888    clear: left;
     889}
     890
     891#surveyEditor {
     892   
     893    margin: 0 auto 0 auto;
     894   
     895    /*background-image: url('../images/bg/sequencerBG.png');*/
     896    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     897    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     898    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     899    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     900    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     901
     902    background-image: -webkit-gradient(
     903        linear,
     904        left top,
     905        left bottom,
     906        color-stop(0.21, #B0B0B0),
     907        color-stop(0.8, #888888)
     908        );
     909    background-position: bottom;
     910    background-repeat: repeat-x;
     911    float: left;
     912   
     913    background-color: #aeb2b3;
     914    border: 1px solid #fff;
     915    -moz-border-radius: 1em;
     916    border-radius: 1em;
     917    margin-bottom: 2em;
     918    padding: 0 1em 1em 1em;
     919    -moz-box-shadow: 2px 2px 1px #888;
     920    -webkit-box-shadow: 2px 2px 1px #888;
     921    box-shadow: 2px 2px 1px #888;
     922}
     923
     924#surveyEditorContent {
     925    overflow-x: hidden;
     926
     927    margin-bottom: 0.5em;
     928
     929    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     930    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     931    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     932    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     933    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     934    background-image: -webkit-gradient(
     935        linear,
     936        left bottom,
     937        left top,
     938        color-stop(0.25, #B0B0B0),
     939        color-stop(0.8, #888888)
     940        );
     941
     942    border: 1px solid #ddd;
     943    -moz-border-radius: 0.5em;
     944    border-radius: 0.5em;
     945    padding: 1em;
     946    float: left;
     947}
     948
     949.questionDisplay {
     950    width: 60em;
     951    border: 1px solid #FFF;
     952    display: block;
     953    margin: 0;
     954    padding: 0;
     955    float: left;
     956    background-color: #5c5c5c;
     957    -moz-box-shadow: 2px 2px 1px #888;
     958    -webkit-box-shadow: 2px 2px 1px #888;
     959    box-shadow: 2px 2px 1px #888;
     960}
     961
     962.questionDisplayContent {
     963    margin: 0;
     964    background-image: linear-gradient(top, #B0B0B0 21%, #888888 80%);
     965    background-image: -o-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     966    background-image: -moz-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     967    background-image: -webkit-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     968    background-image: -ms-linear-gradient(top, #B0B0B0 21%, #888888 80%);
     969    background-image: -webkit-gradient(
     970        linear,
     971        left top,
     972        left bottom,
     973        color-stop(0.25, #B0B0B0),
     974        color-stop(0.8, #888888)
     975        );
     976    padding: 0.5em;
     977}
     978
     979.questionDisplayControls {
     980    text-align: right;
     981}
     982
     983p.questionBody {
     984    border: 1px solid #cccccc;
     985    background-color: #c5c5c5;
     986}
     987
     988#surveyEditorControls {
     989    text-align: right;
     990}
  • Dev/branches/jos-branch/data/questions/questions.rdf

    r230 r233  
    88   xmlns:ns1="http://tbm.tudelft.nl/researchtool/predicates/">
    99
    10 <rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/question/4f012bc097165a431aeed1d8d35e788c">
     10<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/question/fc1d36e1b4b3a320316c710b4d64ab7c">
    1111   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/question"/>
    12    <ns1:question_code>4f012bc097165a431aeed1d8d35e788c</ns1:question_code>
    13    <ns1:title>Titel</ns1:title>
    14    <ns1:description>Beschrijving</ns1:description>
    15    <ns1:question_type>Type</ns1:question_type>
    16    <ns1:question_category>Categorie</ns1:question_category>
    17    <ns1:has_answer>Antwoord1</ns1:has_answer>
    18    <ns1:has_answer>antwoord2</ns1:has_answer>
    19 </rdf:Description>
    20 
    21 <rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/question/fa9eeeaeb582db67d24ccdda20d02c45">
    22    <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/question"/>
    23    <ns1:question_code>fa9eeeaeb582db67d24ccdda20d02c45</ns1:question_code>
    24    <ns1:title>Titel</ns1:title>
    25    <ns1:description>Beschrijving</ns1:description>
    26    <ns1:question_type>Type</ns1:question_type>
    27    <ns1:question_category>Categorie</ns1:question_category>
    28    <ns1:has_answer>Antwoord1</ns1:has_answer>
    29    <ns1:has_answer>antwoord2</ns1:has_answer>
    30 </rdf:Description>
    31 
    32 <rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/question/01d9d6f38924700d82cb4d9c167fb1a3">
    33    <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/question"/>
    34    <ns1:question_code>01d9d6f38924700d82cb4d9c167fb1a3</ns1:question_code>
    35    <ns1:title>Titel</ns1:title>
    36    <ns1:description>Beschrijving</ns1:description>
    37    <ns1:question_type>Type</ns1:question_type>
    38    <ns1:question_category>Categorie</ns1:question_category>
    39    <ns1:has_answer>Antwoord1</ns1:has_answer>
    40    <ns1:has_answer>antwoord2</ns1:has_answer>
     12   <ns1:uid>fc1d36e1b4b3a320316c710b4d64ab7c</ns1:uid>
     13   <ns1:question_code>fc1d36e1b4b3a320316c710b4d64ab7c</ns1:question_code>
     14   <ns1:title>new Question</ns1:title>
     15   <ns1:description>Default description</ns1:description>
     16   <ns1:question_type>int</ns1:question_type>
     17   <ns1:question_category>Standard category</ns1:question_category>
    4118</rdf:Description>
    4219
  • Dev/branches/jos-branch/data/surveys/surveys.rdf

    r230 r233  
    2828</rdf:Description>
    2929
     30<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/survey/bae29873c55ea73a240749b31a34846c">
     31   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/survey"/>
     32   <ns1:uid>bae29873c55ea73a240749b31a34846c</ns1:uid>
     33   <ns1:title>New Survey</ns1:title>
     34   <ns1:description>Default description</ns1:description>
     35   <ns1:creator>41780c9a8e0b87a8533c9c1ba9f6445b</ns1:creator>
     36</rdf:Description>
     37
     38<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/survey/cfa00c5e672b0bc547fd933660c0c6ea">
     39   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/survey"/>
     40   <ns1:uid>cfa00c5e672b0bc547fd933660c0c6ea</ns1:uid>
     41   <ns1:title>New Survey</ns1:title>
     42   <ns1:description>Default description</ns1:description>
     43   <ns1:creator>41780c9a8e0b87a8533c9c1ba9f6445b</ns1:creator>
     44</rdf:Description>
     45
     46<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/survey/75e168550859bb3e5afe5c5983c01854">
     47   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/survey"/>
     48   <ns1:uid>75e168550859bb3e5afe5c5983c01854</ns1:uid>
     49   <ns1:title>New Survey</ns1:title>
     50   <ns1:description>Default description</ns1:description>
     51   <ns1:creator>41780c9a8e0b87a8533c9c1ba9f6445b</ns1:creator>
     52</rdf:Description>
     53
    3054</rdf:RDF>
  • Dev/branches/jos-branch/data/users/users.rdf

    r230 r233  
    5757</rdf:Description>
    5858
     59<rdf:Description rdf:about="http://tbm.tudelft.nl/researchtool/resources/user/41780c9a8e0b87a8533c9c1ba9f6445b">
     60   <ns1:resource_type rdf:resource="http://tbm.tudelft.nl/researchtool/resources/user"/>
     61   <ns1:uid>41780c9a8e0b87a8533c9c1ba9f6445b</ns1:uid>
     62   <ns1:name>Thijs</ns1:name>
     63   <ns1:password>123456789</ns1:password>
     64</rdf:Description>
     65
    5966</rdf:RDF>
  • Dev/branches/jos-branch/index.php

    r230 r233  
    77 */
    88
    9 //Even voor tijdelijk, aangezien er nog pagina's missen en redirects daarom niet goed werken:
     9
    1010if (isset($_SESSION['userUid'])) {
    1111    redirect("logout.php");
  • Dev/branches/jos-branch/returnObjectDisplay.php

    r208 r233  
    33require 'classes/master.php';
    44
    5 /* 
     5/*
    66 * Note: do not try to implement info panel displays in this file as well, it passes and queries a lot of data that you really do not need.
    77 * Since this function will be used so often, adding extra unneeded code to it will slow down the regular operation of the editor (refreshes, etc..) while not offering a significant advantage over the existing getInfo.php
     
    99
    1010
    11 if(isset($_POST['args']) && !empty($_POST['args'])) {
     11if (isset($_POST['args']) && !empty($_POST['args'])) {
    1212    // Get arguments and convert to object
    1313    $input = $_POST['args'];
     
    1717}
    1818
    19 $dbi = new DatabaseInterface();
    2019$outputArray = array();
    2120foreach ($requestArray as $request) {
     21
     22    $type = $request->type;
     23    $results = $type::get(array("uid" => $request->uid));
    2224   
    23     //!!! DEZE SHIT MOET WEER TERUGGEDRAAID WORDEN ZODRA QUESTIONS WEER GEWOON UIDS HEBBEN IPV CODES!
    24     if ($request->type == "Question"){
    25     $results = $dbi->get($request->type, array("code" => $request->uid));
    26     // Bottom line, werkt prima. Questions werken nu op ns1:question_code, accessible als question->code
    27     }
    28     else {
    29         $results =  $dbi->get($request->type, array("uid"=>$request->uid));
    30     }
    3125    if (isset($results) && !empty($results)) {
    3226        is_array($results) ? $object = $results[0] : $object = $results;
     27        if ($object->evaluate()) {
     28            $object->ObjectType = $type;
     29            $outputArray[] = $object;
     30        }
    3331    }
    3432    // We now have the targeted object loaded in memory
    3533    // First add all shared properties
    36     $objectProperties = array(
    37         "uid" => $object->uid,
    38         "title" => $object->title,
    39         "type" => get_class($object),
    40         "description" => $object->description
    41     );
    42     // Then add object-specific properties? (E.G. pipeline for sessions, answertype for questions, age for respondents)
    43     // Nothing so far, though, because data structure changes all the time...
    44     // Then add the resulting array to the outputArray
    45     $outputArray[] = $objectProperties;
    4634}
    4735
    48 
    4936// Encode the output array in JSON format, then send back to the client
    50 $output = json_encode($outputArray);
    51 
    52 die($output);
     37if (!empty($outputArray)) {
     38    echo JSON_encode($outputArray);
     39}
    5340?>
Note: See TracChangeset for help on using the changeset viewer.