Get Survey Summary

From ePrize Developers Wiki

Revision as of 18:24, 21 September 2010 by Todd-chapman (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
$ curl -i -X GET -H "Accept: text/xml" \
  http://127.0.0.1:10001/v1/apps/survey/survey/s14/summary

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 2480
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 18:31:16 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <survey>
    <name>4 questions, 1 optional, 1 text</name>
    <id>s14</id>
    <moniker>simple_survey</moniker>
    <questions>
      <name>q1</name>
      <answers>
        <name>a1</name>
        <answer>This is q1a1</answer>
        <count>0</count>
        <id>a1</id>
        <sort>1</sort>
      </answers>
      <answers>
        <name>a2</name>
        <answer>This is q1a2</answer>
        <count>2</count>
        <id>a2</id>
        <sort>2</sort>
      </answers>
      <count>6</count>
      <id>q1</id>
      <question>This is the first question.</question>
      <sort>1</sort>
      <type>radio</type>
    </questions>
    <questions>
      <name>q2</name>
      <answers>
        <name>a1</name>
        <answer>This is the text of the first answer for the second question.</answer>
        <count>1</count>
        <id>a1</id>
        <sort>1</sort>
      </answers>
      <answers>
        <name>a2</name>
        <answer>Second answer for second question</answer>
        <count>0</count>
        <id>a2</id>
        <sort>2</sort>
      </answers>
      <answers>
        <name>a3</name>
        <answer>3rd answer, 2nd question</answer>
        <count>0</count>
        <id>a3</id>
        <sort>3</sort>
      </answers>
      <count>1</count>
      <id>q2</id>
      <optional>1</optional>
      <question>This is the second question?</question>
      <sort>2</sort>
      <type>checkbox</type>
    </questions>
    <questions>
      <name>q3</name>
      <answers>
        <name>a1</name>
        <answer>First answer</answer>
        <count>0</count>
        <id>a1</id>
        <sort>1</sort>
      </answers>
      <answers>
        <name>a2</name>
        <answer>Second answer</answer>
        <count>3</count>
        <id>a2</id>
        <sort>2</sort>
      </answers>
      <answers>
        <name>a3</name>
        <answer>Thirs answer</answer>
        <count>0</count>
        <id>a3</id>
        <sort>3</sort>
      </answers>
      <count>3</count>
      <id>q3</id>
      <question>Did you know this is the third question?</question>
      <sort>3</sort>
      <type>dropdown</type>
    </questions>
    <questions>
      <name>q4</name>
      <answers></answers>
      <count>2</count>
      <id>q4</id>
      <question>This is a text question. Tell us more about yourself.</question>
      <sort>4</sort>
      <type>text</type>
    </questions>
    <sort>1</sort>
  </survey>
</result>

Graded survey (quiz):

$ curl -i -X GET -H "Accept: text/xml" \
  http://127.0.0.1:10001/v1/apps/survey/survey/s17/summary

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 1429
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 18:32:27 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <grade_summary>
    <passed></passed>
    <taken></taken>
  </grade_summary>
  <survey>
    <name>Must get 50% on this 2 question quiz to pass.</name>
    <grade>50</grade>
    <id>s17</id>
    <moniker>graded_quiz</moniker>
    <questions>
      <name>q1</name>
      <answers>
        <name>a1</name>
        <answer>A</answer>
        <count>0</count>
        <id>a1</id>
      </answers>
      <answers>
        <name>a2</name>
        <answer>B</answer>
        <count>0</count>
        <id>a2</id>
      </answers>
      <answers>
        <name>a3</name>
        <answer>C</answer>
        <count>0</count>
        <id>a3</id>
      </answers>
      <count>0</count>
      <id>q1</id>
      <question>Which is correct?</question>
      <type>radio</type>
    </questions>
    <questions>
      <name>q2</name>
      <answers>
        <name>a1</name>
        <answer>A</answer>
        <count>0</count>
        <id>a1</id>
      </answers>
      <answers>
        <name>a2</name>
        <answer>B</answer>
        <count>0</count>
        <id>a2</id>
      </answers>
      <answers>
        <name>a3</name>
        <answer>C</answer>
        <count>0</count>
        <id>a3</id>
      </answers>
      <count>0</count>
      <id>q2</id>
      <question>Which one is right?</question>
      <type>checkbox</type>
    </questions>
    <sort>2</sort>
  </survey>
</result>

Personality Test:

$ curl -i -X GET -H "Accept: text/xml" \
  http://127.0.0.1:10001/v1/apps/survey/survey/s18/summary

HTTP 200 (OK)
Cache-Control: public
Connection: close
Date: Wed, 01 Jan 2014 05:00:00 GMT
Server: POE HTTPD Component/0.09 (5.008009)
Content-Length: 2700
Content-Type: text/xml; charset=utf-8
Expires: Tue, 21 Sep 2010 18:33:33 GMT

<?xml version="1.0" encoding="UTF-8" ?>
<result>
  <personality_summary>
    <count>0</count>
    <percent>0</percent>
    <personality>country</personality>
  </personality_summary>
  <personality_summary>
    <count>0</count>
    <percent>0</percent>
    <personality>disco</personality>
  </personality_summary>
  <personality_summary>
    <count>0</count>
    <percent>0</percent>
    <personality>rock</personality>
  </personality_summary>
  <personality_summary>
    <count>0</count>
    <percent>0</percent>
    <personality>soul</personality>
  </personality_summary>
  <survey>
    <name>Personality Test: Determine type of music liked based on other factors.</name>
    <id>s18</id>
    <moniker>personality_test</moniker>
    <personality>1</personality>
    <questions>
      <name>q1</name>
      <answers>
        <name>a1</name>
        <answer>Blue</answer>
        <count>0</count>
        <id>a1</id>
        <personality>
          <country>1</country>
          <rock>1</rock>
        </personality>
      </answers>
      <answers>
        <name>a2</name>
        <answer>Pink</answer>
        <count>0</count>
        <id>a2</id>
        <personality>
          <rock>1</rock>
        </personality>
      </answers>
      <answers>
        <name>a3</name>
        <answer>Brown</answer>
        <count>0</count>
        <id>a3</id>
        <personality>
          <country>1</country>
          <soul>1</soul>
        </personality>
      </answers>
      <count>0</count>
      <id>q1</id>
      <question>What's your favorite color?</question>
      <type>radio</type>
    </questions>
    <questions>
      <name>q2</name>
      <answers>
        <name>a1</name>
        <answer>Dapper Dan</answer>
        <count>0</count>
        <id>a1</id>
        <personality>
          <rock>1</rock>
        </personality>
      </answers>
      <answers>
        <name>a2</name>
        <answer>G.I. Joe</answer>
        <count>0</count>
        <id>a2</id>
        <personality>
          <disco>10</disco>
        </personality>
      </answers>
      <answers>
        <name>a3</name>
        <answer>Barbie</answer>
        <count>0</count>
        <id>a3</id>
        <personality>
          <country>1</country>
          <soul>1</soul>
        </personality>
      </answers>
      <answers>
        <name>a4</name>
        <answer>Troll dolls</answer>
        <count>0</count>
        <id>a4</id>
        <personality>
          <country>1</country>
        </personality>
      </answers>
      <count>0</count>
      <id>q2</id>
      <question>What was your favorite toy?</question>
      <type>checkbox</type>
    </questions>
    <sort>3</sort>
  </survey>
</result>
Personal tools