Last change
on this file since 68 was
62,
checked in by basvannuland, 14 years ago
|
updates to the database system. ao New file structure
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | // Survey class as intermediate for storing answer data from the site to the RDF database
|
---|
4 | require_once 'rdfConstants.php';
|
---|
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 |
|
---|
17 | public function __construct($surveyID,$applicationID)
|
---|
18 | {
|
---|
19 | $this->surveyAnswerRDFWriter = new SurveyAnswerRDFWriter($surveyUID,$applicationID);
|
---|
20 | $this->surveyAnswerRDFReader = new SurveyAnswerRDFReader($surveyUID,$applicationID);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public function setRespondentInfo($respondentInfo)
|
---|
24 | {
|
---|
25 | $respondentName = $surveyInfo['respondentName'];
|
---|
26 |
|
---|
27 | $this->surveyAnswerRDFWriter->setRespondentData($respondentName);
|
---|
28 | }
|
---|
29 |
|
---|
30 | public function setSurveyAnswerInfo($surveyInfo)
|
---|
31 | {
|
---|
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 | }
|
---|
52 | }
|
---|
53 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.