Changeset 149 for Dev/trunk/classes/QuestionConnector.php
- Timestamp:
- 11/07/11 16:55:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/QuestionConnector.php
r131 r149 59 59 $keys = array_keys($arguments); 60 60 //Set default values for arguments 61 $uid = "?uid"; $title = "?title"; $type = "?type"; $description = "?description"; $category = "?category"; 61 $uid = "?uid"; $title = "?title"; $type = "?type"; $description = "?description"; $category = "?category"; $has_answer = ""; 62 62 //Set the arguments if they are supplied 63 63 if(in_array("uid", $keys)) … … 70 70 $description = "\"".$arguments["description"]."\""; 71 71 if(in_array("category", $keys)) 72 $style = "\"".$arguments["category"]."\""; 72 $style = "\"".$arguments["category"]."\""; 73 if(in_array("answers", $keys)) 74 { 75 foreach($arguments["answers"] as $answer) 76 { 77 $has_answer = $has_answer . 'predicates:has_answer \'' . $answer . '\' '; 78 } 79 } 73 80 74 81 $querystring = ' 75 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>82 PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '> 76 83 PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '> 77 84 SELECT DISTINCT ?uid, ?title, ?type, ?description, ?category … … 89 96 predicates:question_type ' . $type . ' 90 97 predicates:description ' . $description . ' 91 predicates:question_category ' . $category . ' 98 predicates:question_category ' . $category . ' 99 ' . $has_answer . ' 92 100 }'; 93 101 //Create the querystring 94 102 $results = $this->model->sparqlQuery($querystring); 103 95 104 96 105 $questions = array();
Note: See TracChangeset
for help on using the changeset viewer.