DBA Data[Home] [Help]

PACKAGE: APPS.CS_TP_QUESTIONS_PVT

Source


1 package CS_TP_QUESTIONS_PVT AUTHID CURRENT_USER as
2 /* $Header: cstpqsms.pls 115.15 2002/12/05 22:47:32 wzli noship $ */
3 
4 
5 -- *****************************************************************************
6 -- Start of Comments
7 --
8 --   Record: Question
9 --
10 --
11 --   mQuestionID	        NUMBER
12 --   mQuestionName              VARCHAR2(1000)
13 --   mAnswerType		VARCHAR2(60)
14 --   mMandatoryFlag		VARCHAR2(60)
15 --   mScoringFlag		VARCHAR2(60)
16 --   mLookUpID			NUMBER
17 --   mLast_Updated_Date		VARCHAR2(60)
18 
19 
20 --   newly added  3-11-2002
21 --   mNoteType			VARCHAR2(30)
22 --   mShowOnCreationFlag VARCHAR2(1)
23 -- End of Comments
24 
25 TYPE Question is RECORD (
26      mQuestionID	        NUMBER := FND_API.G_MISS_NUM,
27      mQuestionName              VARCHAR2(2000) := FND_API.G_MISS_CHAR ,
28      mAnswerType		VARCHAR2(60) := FND_API.G_MISS_CHAR,
29      mMandatoryFlag		VARCHAR2(60) := FND_API.G_MISS_CHAR,
30      mScoringFlag		VARCHAR2(60) := FND_API.G_MISS_CHAR,
31      mLookUpID			NUMBER := FND_API.G_MISS_NUM,
32      mLast_Updated_Date		VARCHAR2(60) := FND_API.G_MISS_CHAR ,
33 
34 	mNoteType			VARCHAR2(30),
35      mShowOnCreationFlag VARCHAR2(1)
36 );
37 
38 -- *****************************************************************************
39 -- Start of Comments
40 --
41 --   Table:  Binary Indexed Table of Questions
42 --
43 -- End of Comments
44 
45 TYPE Question_List is TABLE OF Question
46 		INDEX BY BINARY_INTEGER;
47 
48 -- *****************************************************************************
49 --   Display Order Constants are used to dictate the  order of the list of templates/questions queried
50 --        ALPHABATICAL
51 --        REVERSE_ALPHABATICAL
52 --        NORMAL
53 --        CRONOLOGICAL
54 --        REVERSE_CRONOLOGICAL
55          ALPHABATICAL          CONSTANT       VARCHAR(60):='ALPHABATICAL';
56           REVERSE_ALPHABATICAL       CONSTANT   VARCHAR(60):='REVERSE_ALPHABATICAL';
57           NORMAL              CONSTANT             VARCHAR(60):='NORMAL';
58           CRONOLOGICAL        CONSTANT              VARCHAR(60):='CRONOLOGICAL';
59           REVERSE_CRONOLOGICAL        CONSTANT              VARCHAR(60):='REVERSE_CRONOLOGICAL';
60 
61 --       Anwser Type
62 --       Anwer type denotes the answer format to a question.  The two answer types are  freetext and multiple choice.
63 
64          FREETEXT             CONSTANT      VARCHAR (60):='FREETEXT';
65          CHOICE             CONSTANT      VARCHAR (60):='CHOICE';
66 
67 
68 -- *****************************************************************************
69 -- Start of Comments
70 --   This procedure Add_Question add an additional question to the CS_TP_QUESIONS_B and CS_TP_QUESTIONS_TL as well as associate the question to the template id passed in.
71 --   In addition, it will create a lookup id with answer information such as answer type--  and associate it with the question.
72 --  In the Question Record, Question Name and AnswerType need to be valid.  Mandatory Flag and Scoring Flag need to either FND_API.G_TRUE or FND_API.G_FALSE.  Lookup ID, Question ID, Last Updated Date are not needed.
73 -- @param	One_Question          required
74 -- @param	Template_ID           required
75 -- @param	p_api_version_number  required
76 -- @param       p_commit
77 -- @param	p_init_msg_list
78 
79 
80 -- @return	X_Msg_Count
81 --              X_Msg_Data
82 --  	        X_Return_Status
83 --              X_Question_ID
84 -- End of Comments
85 procedure Add_Question  (
86 	p_api_version_number     IN   NUMBER,
87 	p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
88 	p_commit       IN VARCHAR          := FND_API.G_FALSE,
89 	P_One_Question  IN 	Question,
90         p_Template_ID	IN      NUMBER,
91         X_Msg_Count OUT NOCOPY     NUMBER,
92         X_Msg_Data  OUT NOCOPY     VARCHAR2,
93   	X_Return_Status OUT NOCOPY     VARCHAR2,
94 	X_Question_ID OUT NOCOPY     NUMBER);
95 
96 
97 -- *****************************************************************************
98 -- Start of Comments
99 --   This procedure Update_Question modifys an existing question in the CS_TP_QUESIONS_B and CS_TP_QUESTIONS_TL table with what is in the P_One_Question record
100 --  In the Question Record, Question ID is used to identify the question.  Last
101 -- Updated Date is required to check whether the record is updated after the u
102 --ser last queries.    Question Name and AnswerType need to be valid.  Mandato
103 --ry Flag and Scoring Flag need to either FND_API.G_TRUE or FND_API.G_FALSE.  Lookup ID is not needed.
104 --
105 -- @param	P_One_Question          required
106 -- @param	p_api_version_number   required
107 -- @param       p_commit
108 -- @param	p_init_msg_list
109 -- @param       X_Msg_Count
110 -- @param	X_Msg_Data
111 -- @param       X_Return_Status
112 
113 -- @return	X_Msg_Count
114 --              X_Msg_Data
115 --  	        X_Return_Status
116 
117 -- End of Comments
118 
119 procedure Update_Question  (
120 	p_api_version_number     IN   NUMBER,
121 	p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
122 	p_commit       IN VARCHAR          := FND_API.G_FALSE,
123 	P_One_Question  IN 	Question,
124         X_Msg_Count OUT NOCOPY     NUMBER,
125         X_Msg_Data  OUT NOCOPY     VARCHAR2,
126   	X_Return_Status OUT NOCOPY     VARCHAR2);
127 
128 
129 -- *****************************************************************************
130 -- Start of Comments
131 --   This procedure Delete_Question deletes an existing question with passed in Question_ID
132 --@param	p_api_version_number
133 --@param	p_init_msg_list
134 --@param	p_commit
135 --@param        p_One_Question
136 
137 --@return	X_Msg_Count
138 --        	X_Msg_Data
139 --  		X_Return_Status
140 -- End of Comments
141 
142 procedure Delete_Question (
143 	p_api_version_number     IN   NUMBER,
144         p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
145         p_commit       		IN VARCHAR        := FND_API.G_FALSE,
146         p_Question_ID  	IN      NUMBER,
147 	p_Template_ID   IN      NUMBER,
148 	X_Msg_Count OUT NOCOPY     NUMBER,
149         X_Msg_Data  OUT NOCOPY     VARCHAR2,
150   	X_Return_Status OUT NOCOPY     VARCHAR2);
151 
152 -- *****************************************************************************
153 -- Start of Comments
154 --   This procedure Sort_Questions sorts the questions in the order of the list
155 -- of the questions passed in.  The user calls Show_Questions after calling So
156 --rt_Questions and the Show_Questions will return a list of questions in the s
157 --ame order as the order user passed in to the Sort questions.
158 --   User needs to pass in a template ID and a question list in the order that
159 -- the user wishes for the questions to be stored.  In each of the question rec
160 --ord, only the question ID is required.
161 --@param	p_api_version_number  required
162 --@param	p_init_msg_list
163 --@param	p_commit
164 --@param        P_Question_List
165 --@param        P_Template_ID required
166 --@return	X_Msg_Count
167 --        	X_Msg_Data
168 --  		X_Return_Status
169 -- End of Comments
170 
171 procedure Sort_Questions (
172 	p_api_version_number     IN   NUMBER,
173 	p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
174 	p_commit       IN VARCHAR          := FND_API.G_FALSE,
175 	P_Questions		IN    Question_List,
176          P_Template_ID            IN      NUMBER,
177 	X_Msg_Count  OUT NOCOPY NUMBER,
178   	X_Msg_Data    OUT NOCOPY VARCHAR2,
179  	X_Return_Status   OUT NOCOPY VARCHAR2
180 );
181 
182 -- *****************************************************************************
183 -- Start of Comments
184 --
185 -- Show_Questions  takes two numbers P_Start_Question  and P_End_Question as th
186 --e start question number and end question number,and the Display Order of the
187 --questions.  It will return a table of questions, the total number of questio
188 -- available and the total number retrieved.
189 --@param	P_Start_Question
190 --@param	P_End_Question
191 --@param	P_Display_Order
192 -- @param	p_api_version_number   required
193 -- @param       p_commit
194 -- @param	p_init_msg_list
195 
196 -- @return	X_Msg_Count
197 --              X_Msg_Data
198 --  	        X_Return_Status
199 --		X_Question_List_To_Show
200 --		X_Total_Questions
201 --		X_Retrieved_Question_Number
202 
203 -- End of Comments
204 
205 procedure Show_Questions  (
206 	p_api_version_number     IN   NUMBER,
207 	p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
208 	p_commit       IN VARCHAR          := FND_API.G_FALSE,
209         P_Template_ID           IN NUMBER,
210 	P_Start_Question 	IN NUMBER,
211 	P_End_Question 		IN NUMBER,
212 	P_Display_Order 	IN VARCHAR2,
213  	X_Msg_Count   OUT NOCOPY NUMBER,
214  	X_Msg_Data    OUT NOCOPY VARCHAR2,
215  	X_Return_Status  OUT NOCOPY VARCHAR2,
216 	X_Question_List_To_Show OUT NOCOPY Question_List,
217         X_Total_Questions      OUT NOCOPY NUMBER,
218         X_Retrieved_Question_Number OUT NOCOPY NUMBER
219        );
220 
221 -- *****************************************************************************
222 -- Start of Comments
223 --
224 -- Show_Question returns a quesion record which takes a question id and returns a question record.
225 -- @param 	p_Question_ID  required
226 -- @param	p_api_version_number   required
227 -- @param       p_commit
228 -- @param	p_init_msg_list
229 
230 -- @return	X_Msg_Count
231 --              X_Msg_Data
232 --  	        X_Return_Status
233 --		X_Question_To_Show
234 -- End of Comments
235 
236 procedure Show_Question (
237 	p_api_version_number     IN   NUMBER,
238 	p_init_msg_list          IN   VARCHAR2  := FND_API.G_FALSE,
239 	p_commit       IN VARCHAR          := FND_API.G_FALSE,
240 	P_Question_ID   	IN NUMBER,
241    	X_Msg_Count   OUT NOCOPY NUMBER,
242   	X_Msg_Data		OUT NOCOPY VARCHAR2,
243   	X_Return_Status		OUT NOCOPY VARCHAR2,
244 	X_Question_To_Show  OUT NOCOPY Question
245         );
246 
247 
248 end  CS_TP_QUESTIONS_PVT;