Ignore:
Timestamp:
11/07/11 16:55:36 (13 years ago)
Author:
jkraaijeveld
Message:

Added missing classes for the database connection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/QuestionConnector.php

    r131 r149  
    5959        $keys = array_keys($arguments);
    6060        //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 = "";
    6262        //Set the arguments if they are supplied
    6363        if(in_array("uid", $keys))
     
    7070            $description = "\"".$arguments["description"]."\"";
    7171        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                }
    7380           
    7481        $querystring = '
    75          PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
     82            PREFIX  predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
    7683            PREFIX  resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
    7784            SELECT DISTINCT ?uid, ?title, ?type, ?description, ?category
     
    8996                predicates:question_type ' . $type . '
    9097                predicates:description ' . $description . '
    91                 predicates:question_category ' . $category . '
     98                                predicates:question_category ' . $category . '
     99                                ' . $has_answer . '
    92100            }';
    93101        //Create the querystring
    94102        $results = $this->model->sparqlQuery($querystring);
     103
    95104       
    96105        $questions = array();
Note: See TracChangeset for help on using the changeset viewer.