RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
CognitiveGetScores.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class CognitiveGetScores(CloudMsg):
12  """ Cognitive Get Scores Cloud Message object """
13 
14  class Request(CloudRequest):
15  """ Cognitive Get Scores Cloud Request object.
16 
17  CognitiveGetScores.Request
18  """
19  def __init__(self, **kwargs):
20  """!
21  Constructor
22 
23  @param **kwargs - Keyword arguments. Apply values to the request attributes.
24  - @ref test_type
25  - @ref time_to
26  """
27 
28  ## Cognitive Exercise test type. Can be one of:
29  # - 'ArithmeticCts'
30  # - 'AwarenessCts'
31  # - 'ReasoningCts'
32  # - ''
33  #
34  # If left empty, history of all test types will be returned.
35  self.test_type = ''
36  ## Unix timestamp. Retrieve scores up to this timestamp value.
37  self.time_to = 0
38  super(CognitiveGetScores.Request, self).__init__(**kwargs)
39 
40 
41  def make_payload(self):
42  """ Create and return the Payload of the Request. """
43  return Payload(
44  up_to_time=self.time_to,
45  test_type=self.test_type)
46 
47 
48  def make_files(self):
49  """ Create and return Array of File objects of the Request. """
50  return []
51 
52 
53  class Response(CloudResponse):
54  """ Cognitive Get Scores Cloud Response object.
55 
56  CognitiveGetScores.Response
57  """
58  def __init__(self, **kwargs):
59  """!
60  Constructor
61 
62  @param **kwargs - Keyword arguments. Apply values to the request attributes.
63  - @ref error
64  - @ref test_classes
65  - @ref scores
66  """
67 
68  ## Error message
69  self.error = ''
70  ## Array of the test classes indexes.
71  self.test_classes = []
72  ## Array of scores. Each array index corresponds to the test class
73  # in @ref test_classes
74  self.scores = []
75  super(CognitiveGetScores.Response, self).__init__(**kwargs)
76 
77 
78  def __init__(self, **kwargs):
79  """!
80  Constructor
81 
82  @param **kwargs - Keyword argumen.ts. Apply values to the request attributes.
83  - @ref Request.test_type
84  - @ref Request.time_to
85  """
86 
87  # Create and hold the Request object for this CloudMsg
89  # Create and hold the Response object for this CloudMsg
91  super(CognitiveGetScores, self).__init__(
92  svcname='cognitive_get_scores', **kwargs)
93 
94