Changeset 233 for Dev/branches/jos-branch
- Timestamp:
- 01/13/12 13:57:41 (13 years ago)
- Location:
- Dev/branches/jos-branch
- Files:
-
- 34 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jos-branch/classes/models/Question.php
r217 r233 12 12 private static $filename = 'data/questions/questions.rdf'; 13 13 14 public $code; 14 15 public $title; 15 16 public $type; … … 27 28 * @param type $answers 28 29 */ 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) 30 31 { 31 32 if(!isset($uid)) … … 33 34 $uid = md5(uniqid(rand(), true)); 34 35 } 36 $this->code = $code; 35 37 $this->uid = $uid; 36 38 $this->title = $title; … … 61 63 $predicateRType = new Resource(RTYPE); 62 64 $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)); 63 69 64 70 $questionQCode = new Literal($this->uid); … … 98 104 * Get the questions corresponding to the arguments. 99 105 * @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'. 101 107 */ 102 108 public static function get($arguments) … … 107 113 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '> 108 114 PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '> 109 SELECT DISTINCT ?uid, ? title, ?type, ?description, ?category115 SELECT DISTINCT ?uid, ?code, ?title, ?type, ?description, ?category 110 116 WHERE 111 117 { 112 118 _question predicates:resource_type resources:question ; 113 predicates:question_code ?uid ; 119 predicates:uid ?uid ; 120 predicates:question_code ?code ; 114 121 predicates:title ?title ; 115 122 predicates:question_type ?type ; … … 130 137 { 131 138 $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); 133 140 } 134 141 } -
Dev/branches/jos-branch/classes/models/ResearchToolObject.php
r212 r233 5 5 * @author jkraaijeveld 6 6 */ 7 // Survey database interface class as intermediate for storing data from the site to the RDF database 8 require_once 'rdfConstants.php'; 9 // Include RAP Library to write RDF files 10 include(RDFAPI_INCLUDE_DIR . "RDFAPI.php"); 11 12 7 13 abstract class ResearchToolObject { 8 14 -
Dev/branches/jos-branch/classes/widgets/SurveyEditorWidget.php
r230 r233 13 13 14 14 private $loadedSurvey; 15 private $dbi;16 15 17 16 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 21 18 } 22 19 23 20 public function handlePost() { 24 21 // Get POSTed data and store variables to class instance properties 25 $dbi = new DatabaseInterface();22 26 23 if (isset($_POST['objectUid']) && !empty($_POST['objectUid'])) { 27 $surveyResults = $dbi->get("Survey",array("uid" => $_POST['objectUid']));24 $surveyResults = Survey::get(array("uid" => $_POST['objectUid'])); 28 25 if (!empty($surveyResults)) { 29 26 $this->loadedSurvey = $surveyResults[0]; … … 39 36 $questionString = ""; 40 37 foreach ($this->loadedSurvey->questions as $question) { 41 $questionString .= $question-> code. ",";38 $questionString .= $question->uid . ","; 42 39 } 43 40 // echo the HTML markup to display the editor on the screen -
Dev/branches/jos-branch/classes/widgets/Toolbox.php
r230 r233 25 25 <div class="bigButton toolbox" onclick="ddMenu.Open('toolbox_m1')"><img src="images/icons/survey.png" class="buttonIcon" /><p>Survey</p> 26 26 <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> 28 28 <a href="#">> Add existing</a> 29 29 </div> … … 34 34 <div class="bigButton toolbox" onClick="ddMenu.Open('toolbox_m2')"><img src="images/icons/application.png" class="buttonIcon" /><p>Application</p> 35 35 <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> 37 37 <a href="#">> Add existing</a> 38 38 </div> -
Dev/branches/jos-branch/createObject.php
r208 r233 13 13 } 14 14 15 $dbi = new DatabaseInterface(); 16 $creator_results = $dbi->get("User",array("uid" => $_SESSION['userUid']));15 16 $creator_results = User::get(array("uid" => $_SESSION['userUid'])); 17 17 $creator = $creator_results[0]; 18 18 … … 27 27 case "application": 28 28 $newApp = new Application(null, "New application", "Default description", "Default style"); 29 $ dbi->set($newApp);29 $newApp->save(); 30 30 $uid = $newApp->uid; 31 31 break; 32 32 case "survey": 33 33 $newSurvey = new Survey(null, "New Survey", "Default description", $creator, null); 34 $ dbi->set($newSurvey);34 $newSurvey->save(); 35 35 $uid = $newSurvey->uid; 36 36 break; … … 39 39 break; 40 40 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(); 43 43 $uid = $newQuestion->uid; 44 44 break; -
Dev/branches/jos-branch/css/awesome.css
r112 r233 32 32 } 33 33 34 label {35 font-size: small;36 font-weight: bold;37 color: #333;38 text-shadow: #fff 0px 0px 1px;39 }40 41 34 legend { 42 35 padding-left: 0em; … … 48 41 background-color: #aeb2b3; 49 42 border: 1px solid #fff; 50 -moz-border-radius: 1 5px;51 border-radius: 1 5px;43 -moz-border-radius: 1em; 44 border-radius: 1em; 52 45 margin-bottom: 2em; 53 46 padding: 0 1em 1em 1em; … … 59 52 background-image: url('../images/bg/blueishgridblock.png'); 60 53 height: 100%; 54 font-size: 12px; 61 55 } 62 56 … … 107 101 font-weight: bold; 108 102 text-align: center; 109 line-height: 2em; 103 padding-top: 15px; 104 /*line-height: 2em;*/ 110 105 text-shadow: #555 0px 0px .2em; 111 106 height: 189px; … … 259 254 -moz-border-radius: 6px; 260 255 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; 261 267 } 262 268 … … 549 555 550 556 #questionEditForm { 551 557 552 558 } 553 559 … … 557 563 color:white; 558 564 } 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 804 fieldset 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 983 p.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 8 8 xmlns:ns1="http://tbm.tudelft.nl/researchtool/predicates/"> 9 9 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"> 11 11 <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> 41 18 </rdf:Description> 42 19 -
Dev/branches/jos-branch/data/surveys/surveys.rdf
r230 r233 28 28 </rdf:Description> 29 29 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 30 54 </rdf:RDF> -
Dev/branches/jos-branch/data/users/users.rdf
r230 r233 57 57 </rdf:Description> 58 58 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 59 66 </rdf:RDF> -
Dev/branches/jos-branch/index.php
r230 r233 7 7 */ 8 8 9 //Even voor tijdelijk, aangezien er nog pagina's missen en redirects daarom niet goed werken: 9 10 10 if (isset($_SESSION['userUid'])) { 11 11 redirect("logout.php"); -
Dev/branches/jos-branch/returnObjectDisplay.php
r208 r233 3 3 require 'classes/master.php'; 4 4 5 /* 5 /* 6 6 * 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. 7 7 * 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 … … 9 9 10 10 11 if (isset($_POST['args']) && !empty($_POST['args'])) {11 if (isset($_POST['args']) && !empty($_POST['args'])) { 12 12 // Get arguments and convert to object 13 13 $input = $_POST['args']; … … 17 17 } 18 18 19 $dbi = new DatabaseInterface();20 19 $outputArray = array(); 21 20 foreach ($requestArray as $request) { 21 22 $type = $request->type; 23 $results = $type::get(array("uid" => $request->uid)); 22 24 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->code27 }28 else {29 $results = $dbi->get($request->type, array("uid"=>$request->uid));30 }31 25 if (isset($results) && !empty($results)) { 32 26 is_array($results) ? $object = $results[0] : $object = $results; 27 if ($object->evaluate()) { 28 $object->ObjectType = $type; 29 $outputArray[] = $object; 30 } 33 31 } 34 32 // We now have the targeted object loaded in memory 35 33 // First add all shared properties 36 $objectProperties = array(37 "uid" => $object->uid,38 "title" => $object->title,39 "type" => get_class($object),40 "description" => $object->description41 );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 outputArray45 $outputArray[] = $objectProperties;46 34 } 47 35 48 49 36 // Encode the output array in JSON format, then send back to the client 50 $output = json_encode($outputArray); 51 52 die($output); 37 if (!empty($outputArray)) { 38 echo JSON_encode($outputArray); 39 } 53 40 ?>
Note: See TracChangeset
for help on using the changeset viewer.