Changeset 158 for Dev/trunk/classes/QuestionConnector.php
- Timestamp:
- 11/18/11 11:07:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/QuestionConnector.php
r149 r158 50 50 /** 51 51 * Get the questions corresponding to the arguments. 52 * @param type $arguments 53 * @return type Array 52 * @param type $arguments : An array having one ore more of the following elements: 53 * 'uid', 'title', 'type', 'description', 'category', 'has_answer'. 54 54 */ 55 55 public function get($arguments) … … 59 59 $keys = array_keys($arguments); 60 60 //Set default values for arguments 61 $uid = " ?uid"; $title = "?title"; $type = "?type"; $description = "?description"; $category = "?category"; $has_answer = "";61 $uid = ""; $title = ""; $type = ""; $description = ""; $category = ""; $has_answer = ""; 62 62 //Set the arguments if they are supplied 63 63 if(in_array("uid", $keys)) 64 $uid = ' \''.$arguments["uid"].'\'';64 $uid = 'predicates:question_code \''.$arguments["uid"].'\''; 65 65 if(in_array("title", $keys)) 66 $title = ' \''.$arguments["title"].'\'';66 $title = 'predicates:title \''.$arguments["title"].'\''; 67 67 if(in_array("type", $keys)) 68 $type = ' \''.$arguments["type"].'\'';68 $type = 'predicates:type \''.$arguments["type"].'\''; 69 69 if(in_array("description", $keys)) 70 $description = " \"".$arguments["description"]."\"";70 $description = "predicates:description \"".$arguments["description"]."\""; 71 71 if(in_array("category", $keys)) 72 $style = " \"".$arguments["category"]."\"";72 $style = "predicates:category \"".$arguments["category"]."\""; 73 73 if(in_array("answers", $keys)) 74 74 { … … 91 91 predicates:description ?description ; 92 92 predicates:question_category ?category ; 93 94 predicates:question_code ' . $uid . ' 95 predicates:title ' . $title . ' 96 predicates:question_type ' . $type . ' 97 predicates:description ' . $description . ' 98 predicates:question_category ' . $category . ' 99 ' . $has_answer . ' 93 '. $uid . $title . $type . $description . $category . $has_answer . ' 100 94 }'; 101 95 //Create the querystring … … 117 111 /** 118 112 * Gets the answers belonging to the given uid. 119 * @param type $uid 120 * @return type Array 113 * @param type $uid : The uid of the Question in question (haha, pun). 121 114 */ 122 115 private function getAnswers($uid) … … 148 141 /** 149 142 * Save the given ResearchTool object 150 * @param type $rToolObject 143 * @param type $rToolObject : The ResearchToolObject to be saved. 151 144 */ 152 145 public function set($rToolObject)
Note: See TracChangeset
for help on using the changeset viewer.