Last change
on this file since 75 was
62,
checked in by basvannuland, 14 years ago
|
updates to the database system. ao New file structure
|
File size:
1.2 KB
|
Rev | Line | |
---|
[31] | 1 | <?php
|
---|
| 2 |
|
---|
[62] | 3 | // Survey class as intermediate for storing answer data from the site to the RDF database
|
---|
[45] | 4 | require_once 'rdfConstants.php';
|
---|
[31] | 5 |
|
---|
| 6 | // Include RAP Library to write RDF files
|
---|
| 7 | include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 |
|
---|
| 11 | class SurveyAnswerDatabaseInterface
|
---|
| 12 | {
|
---|
| 13 | protected $surveyAnswerRDFWriter;
|
---|
| 14 | protected $surveyAnswerRDFReader;
|
---|
| 15 |
|
---|
| 16 |
|
---|
[62] | 17 | public function __construct($surveyID,$applicationID)
|
---|
[40] | 18 | {
|
---|
[62] | 19 | $this->surveyAnswerRDFWriter = new SurveyAnswerRDFWriter($surveyUID,$applicationID);
|
---|
| 20 | $this->surveyAnswerRDFReader = new SurveyAnswerRDFReader($surveyUID,$applicationID);
|
---|
[31] | 21 | }
|
---|
| 22 |
|
---|
[62] | 23 | public function setRespondentInfo($respondentInfo)
|
---|
| 24 | {
|
---|
| 25 | $respondentName = $surveyInfo['respondentName'];
|
---|
| 26 |
|
---|
| 27 | $this->surveyAnswerRDFWriter->setRespondentData($respondentName);
|
---|
| 28 | }
|
---|
| 29 |
|
---|
[40] | 30 | public function setSurveyAnswerInfo($surveyInfo)
|
---|
| 31 | {
|
---|
[62] | 32 |
|
---|
| 33 | $qAnswers = array();
|
---|
| 34 | $qNumber = 1;
|
---|
| 35 | while (isset($surveyInfo['questionID'.$qNumber]))
|
---|
| 36 | {
|
---|
| 37 | if (isset($surveyInfo['q'.$qNumber.'answered']))
|
---|
| 38 | {
|
---|
| 39 | $qAnswers[$surveyInfo['questionID'.$qNumber]] = $surveyInfo['q'.$qNumber.'answered'];
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | $qNumber++;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | $this->surveyAnswerRDFWriter->setAnswers($qAnswers);
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | public function getSurveyAnswerInfo()
|
---|
| 49 | {
|
---|
| 50 |
|
---|
| 51 | }
|
---|
[33] | 52 | }
|
---|
[31] | 53 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.