Ignore:
Timestamp:
02/17/12 13:21:55 (13 years ago)
Author:
jkraaijeveld
Message:

Implemented SurveyInstance?

Location:
Dev/branches/jos-branch/server
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/jos-branch/server

    • Property svn:ignore set to
      .testpage.php.swp
      .rdfConstants.php.swp
  • Dev/branches/jos-branch/server/classes/models

    • Property svn:ignore set to
      .SurveyInstance.php.swp
      .ApplicationInstance.php.swp
      .AnswerSet.php.swp
      .Answer.php.swp
      .Question.php.swp
  • Dev/branches/jos-branch/server/classes/models/Answer.php

    r263 r268  
    4040                if(is_string($this->question))
    4141                {
    42                         $result = Question::get(array("code" => $this->question));
     42                        $result = Question::get(array("uid" => $this->question));
    4343                        if(!isset($result[0]))
    4444                                return false;
     
    7373                //Query the model
    7474                $results = $model->sparqlQuery($querystring);   
    75                 //An answer can have multiple values, get all these values for the answer instances found.
     75        //An answer can have multiple values, get all these values for the answer instances found.
    7676                $answers = array();
    7777                if(!empty($results))
  • Dev/branches/jos-branch/server/classes/models/AnswerSet.php

    r263 r268  
    8080        public function save()
    8181        {
    82                 //If evaluation fails, some references are incorrect.
    83                 //We shouldn't save in this case. Instead - let the user know. This function returns false if the evaluation has failed.
     82                //If evaluation fails, some references are incorrect. We shouldn't save in this case.
    8483                //TODO: Decide how to fix invalid references graciously.
    8584                if(!$this->evaluate())
  • Dev/branches/jos-branch/server/classes/models/Question.php

    r256 r268  
    6868        $model->add(new Statement($resourceQuestion,$predicateUid,$questionUid));
    6969       
    70         $questionQCode = new Literal($this->uid);
     70        $questionQCode = new Literal($this->code);
    7171        $predicateQCode = new Resource(QCODE);
    7272        $model->add(new Statement($resourceQuestion,$predicateQCode,$questionQCode));
     
    124124                predicates:question_category ?category ;
    125125                                '. ResearchToolObject::createArguments($arguments) . '
    126         }';
     126                        }';
    127127
    128128               
    129129        //Create the querystring
    130130        $results = $model->sparqlQuery($querystring);
    131 
    132131       
    133132        $questions = array();
     
    144143   
    145144    /**
    146      * Gets the answers belonging to the given uid.
     145     * Gets the preset answers belonging to the given uid.
    147146     * @param type $uid : The uid of the Question in question (haha, pun).
    148147     */
  • Dev/branches/jos-branch/server/rdfConstants.php

    r256 r268  
    2525define('RESULTSET', SURVEYTOOL_RESOURCES_NAMESPACE . 'resultset');
    2626define('APPLICATIONINSTANCE', SURVEYTOOL_RESOURCES_NAMESPACE . 'applicationinstance');
     27define('SURVEYINSTANCE', SURVEYTOOL_RESOURCES_NAMESPACE . 'surveyinstance');
    2728
    2829// Predicates used for RDF triples
     
    6566define('CREATIONDATE', SURVEYTOOL_PREDICATES_NAMESPACE . 'creationdate');
    6667define('OPEN', SURVEYTOOL_PREDICATES_NAMESPACE . 'open');
     68define('OF_SURVEY', SURVEYTOOL_PREDICATES_NAMESPACE . 'of_survey');
     69define('PRESET_ANSWER', SURVEYTOOL_PREDICATES_NAMESPACE . 'preset_answer');
    6770?>
Note: See TracChangeset for help on using the changeset viewer.