Menu

[r3]: / py_top_web_client_01 / PSQuestionDetailsView.py  Maximize  Restore  History

Download this file

472 lines (433 with data), 23.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
from os.path import getmtime, exists
import time
import types
import __builtin__
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
from Cheetah.Template import Template
from Cheetah.DummyTransaction import DummyTransaction
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
from Cheetah.CacheRegion import CacheRegion
import Cheetah.Filters as Filters
import Cheetah.ErrorCatchers as ErrorCatchers
##################################################
## MODULE CONSTANTS
try:
True, False
except NameError:
True, False = (1==1), (1==0)
VFFSL=valueFromFrameOrSearchList
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
__CHEETAH_version__ = '2.0rc8'
__CHEETAH_versionTuple__ = (2, 0, 0, 'candidate', 8)
__CHEETAH_genTime__ = 1189741982.350836
__CHEETAH_genTimestamp__ = 'Thu Sep 13 23:53:02 2007'
__CHEETAH_src__ = 'PSQuestionDetailsView.tmpl'
__CHEETAH_srcLastModified__ = 'Wed Aug 22 23:06:30 2007'
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
raise AssertionError(
'This template was compiled with Cheetah version'
' %s. Templates compiled before version %s must be recompiled.'%(
__CHEETAH_version__, RequiredCheetahVersion))
##################################################
## CLASSES
class PSQuestionDetailsView(Template):
##################################################
## CHEETAH GENERATED METHODS
def __init__(self, *args, **KWs):
Template.__init__(self, *args, **KWs)
if not self._CHEETAH__instanceInitialized:
cheetahKWArgs = {}
allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
for k,v in KWs.items():
if k in allowedKWs: cheetahKWArgs[k] = v
self._initCheetahInstance(**cheetahKWArgs)
def respond(self, trans=None):
## CHEETAH: main method generated for this template
if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)):
trans = self.transaction # is None unless self.awake() was called
if not trans:
trans = DummyTransaction()
_dummyTrans = True
else: _dummyTrans = False
write = trans.response().write
SL = self._CHEETAH__searchList
_filter = self._CHEETAH__currentFilter
########################################
## START - generated method body
write('''<h1>Question: ''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 2, col 15
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 2, col 15.
write('''</h1>\r
<div id="error_div" class="errmsg">''')
_v = VFFSL(SL,"err_msg",True) # '$err_msg' on line 3, col 36
if _v is not None: write(_filter(_v, rawExpr='$err_msg')) # from line 3, col 36.
write('''</div>\r
<div id="status_div" class="statmsg">''')
_v = VFFSL(SL,"status_msg",True) # '$status_msg' on line 4, col 38
if _v is not None: write(_filter(_v, rawExpr='$status_msg')) # from line 4, col 38.
write('''</div>\r
<input type="hidden" name="top_status" id="top_status" value="ready"/>\r
\r
<h2>Question Properties</h2>\r
<p>\r
The Question \'''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 9, col 15
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 9, col 15.
write('''\' has the following properties:\r
</p>\r
<table border="0" class="ps_properties">\r
\r
<!-- Question name -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_name">Question\'s name:</label>\r
</td>\r
<td>\r
<input id="sqp_name" class="left" type="text" size="50" maxlength="125" onclick="enable_button(\'sqp_button\')" name="name" value="''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 19, col 142
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 19, col 142.
write('''"/>\r
</td>\r
</tr>\r
<tr>\r
<td/>\r
<td>\r
The Question\'s name is not visible to the end-user. It is for configuration purposes only.\r
</td>\r
</tr>\r
\r
<!-- Question prompt -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_prompt">Prompt:</label>\r
</td>\r
<td>\r
<textarea id="sqp_prompt" name="prompt" class="left" rows="2" cols="50" onclick="enable_button(\'sqp_button\')">''')
_v = VFFSL(SL,"prompt",True) # '$prompt' on line 35, col 124
if _v is not None: write(_filter(_v, rawExpr='$prompt')) # from line 35, col 124.
write('''</textarea>\r
</td>\r
</tr>\r
\r
<!-- Question answer type -->\r
<tr>\r
<td>\r
<label class="right">Answer Type:</label>\r
</td>\r
<td>\r
''')
if VFFSL(SL,"answer_type",True) == 'top:no_answer': # generated from line 45, col 13
write(''' <input id="sqp_no_answer" checked="y" name="answer_type" type="radio" onclick="hide_qdt_modules()"/>\r
''')
else: # generated from line 47, col 13
write(''' <input id="sqp_no_answer" name="answer_type" type="radio" onclick="hide_qdt_modules()"/>\r
''')
write(''' <label for="sqp_no_answer">No Answer Requested</label>\r
<br/>\r
\r
''')
if VFFSL(SL,"answer_type",True) == 'top:literal_answer_type': # generated from line 53, col 13
write(''' <input id="sqp_literal_answer_type" checked="y" name="answer_type" type="radio" onclick="show_qdt_literal_module()"/>\r
''')
else: # generated from line 55, col 13
write(''' <input id="sqp_literal_answer_type" name="answer_type" type="radio" onclick="show_qdt_literal_module()"/>\r
''')
write(''' <label for="sqp_literal_answer_type">Text/Numeric Answer</label>\r
<br/>\r
\r
''')
if VFFSL(SL,"answer_type",True) == 'top:tag_answer_type': # generated from line 61, col 13
write(''' <input id="sqp_tag_answer_type" checked="y" name="answer_type" type="radio" onclick="show_qdt_tag_module()"/>\r
''')
else: # generated from line 63, col 13
write(''' <input id="sqp_tag_answer_type" name="answer_type" type="radio" onclick="show_qdt_tag_module()"/>\r
''')
write(''' <label for="sqp_tag_answer_type">Tag Answer</label>\r
</td>\r
</tr>\r
\r
<!-- Question literal answer type -->\r
<tr>\r
<td/>\r
<td>\r
<div id="qdt_literal_module_div">\r
<div class="hd"/>\r
<div class="bd">\r
<div class="ptext1">Select the data type for the answer:<br clear="all" /></div>\r
''')
if VFFSL(SL,"literal_type",True) == 'top:text_literal': # generated from line 78, col 21
write(''' <input id="sqp_lt_text" checked="y" name="sqp_lt_gp" type="radio" onclick="text_literal_type_selected()"/>\r
<label for="sqp_lt_text">Text,</label>\r
&nbsp;&nbsp;(lenght:&nbsp;\r
<input id="sqp_lt_text_min" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_min" value="''')
_v = VFFSL(SL,"literal_text_min",True) # '$literal_text_min' on line 82, col 149
if _v is not None: write(_filter(_v, rawExpr='$literal_text_min')) # from line 82, col 149.
write('''"/>\r
<label for="sqp_lt_text_min">Min</label>\r
&nbsp;\r
<input id="sqp_lt_text_max" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_max" value="''')
_v = VFFSL(SL,"literal_text_max",True) # '$literal_text_max' on line 85, col 149
if _v is not None: write(_filter(_v, rawExpr='$literal_text_max')) # from line 85, col 149.
write('''"/>\r
<label for="sqp_lt_text_max">Max)</label>\r
''')
else: # generated from line 87, col 21
write(''' <input id="sqp_lt_text" name="sqp_lt_gp" type="radio" onclick="text_literal_type_selected()"/>\r
<label for="sqp_lt_text">Text,</label>\r
&nbsp;&nbsp;(lenght:&nbsp;\r
<input id="sqp_lt_text_min" disabled="y" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_min" value="''')
_v = VFFSL(SL,"literal_text_min",True) # '$literal_text_min' on line 91, col 162
if _v is not None: write(_filter(_v, rawExpr='$literal_text_min')) # from line 91, col 162.
write('''"/>\r
<label for="sqp_lt_text_min">Min</label>\r
&nbsp;\r
<input id="sqp_lt_text_max" disabled="y" type="text" size="3" maxlength="4" onclick="enable_button(\'sqp_button\')" name="text_max" value="''')
_v = VFFSL(SL,"literal_text_max",True) # '$literal_text_max' on line 94, col 162
if _v is not None: write(_filter(_v, rawExpr='$literal_text_max')) # from line 94, col 162.
write('''"/>\r
<label for="sqp_lt_text_max">Max)</label>\r
''')
write(''' <br/>\r
\r
''')
if VFFSL(SL,"literal_type",True) == 'top:int_literal': # generated from line 99, col 21
write(''' <input id="sqp_lt_int" checked="y" name="sqp_lt_gp" type="radio" onclick="int_literal_type_selected()"/>\r
<label for="sqp_lt_int">Integer,</label>\r
&nbsp;&nbsp;(range:&nbsp;\r
<input id="sqp_lt_int_min" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_min" value="''')
_v = VFFSL(SL,"literal_int_min",True) # '$literal_int_min' on line 103, col 147
if _v is not None: write(_filter(_v, rawExpr='$literal_int_min')) # from line 103, col 147.
write('''"/>\r
<label for="sqp_lt_int_min">Min</label>\r
&nbsp;\r
<input id="sqp_lt_int_max" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_max" value="''')
_v = VFFSL(SL,"literal_int_max",True) # '$literal_int_max' on line 106, col 147
if _v is not None: write(_filter(_v, rawExpr='$literal_int_max')) # from line 106, col 147.
write('''"/>\r
<label for="sqp_lt_int_max">Max)</label>\r
''')
else: # generated from line 108, col 21
write(''' <input id="sqp_lt_int" name="sqp_lt_gp" type="radio" onclick="int_literal_type_selected()"/>\r
<label for="sqp_lt_int">Integer,</label>\r
&nbsp;&nbsp;(range:&nbsp;\r
<input id="sqp_lt_int_min" disabled="y" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_min" value="''')
_v = VFFSL(SL,"literal_int_min",True) # '$literal_int_min' on line 112, col 160
if _v is not None: write(_filter(_v, rawExpr='$literal_int_min')) # from line 112, col 160.
write('''"/>\r
<label for="sqp_lt_int_min">Min</label>\r
&nbsp;\r
<input id="sqp_lt_int_max" disabled="y" type="text" size="6" maxlength="8" onclick="enable_button(\'sqp_button\')" name="int_max" value="''')
_v = VFFSL(SL,"literal_int_max",True) # '$literal_int_max' on line 115, col 160
if _v is not None: write(_filter(_v, rawExpr='$literal_int_max')) # from line 115, col 160.
write('''"/>\r
<label for="sqp_lt_int_max">Max)</label>\r
''')
write(''' <br/>\r
\r
''')
if VFFSL(SL,"literal_type",True) == 'top:date_literal': # generated from line 120, col 21
write(''' <input id="sqp_lt_date" checked="y" name="sqp_lt_gp" type="radio" onclick="date_literal_type_selected()"/>\r
''')
else: # generated from line 122, col 21
write(''' <input id="sqp_lt_date" name="sqp_lt_gp" type="radio" onclick="date_literal_type_selected()"/>\r
''')
write(''' <label for="sqp_lt_date">Date,</label>\r
&nbsp;&nbsp;(format: \'YYYY-MM-DD\')\r
\r
<!-- Added 07/10/07 for domain_predicate -->\r
<div class="ptext2">Select the Domain Property associated with this Question:<br clear="all" /></div>\r
<select id="sqp_l_domain_predicate" name="dpredicate" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"domain_predicate",True) == '': # generated from line 132, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Domain Property</option>\r
''')
for predicate_name in VFFSL(SL,"all_domain_properties",True): # generated from line 136, col 25
write(''' <option value ="''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 137, col 45
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 137, col 45.
write('''"\r
''')
if VFFSL(SL,"domain_predicate",True) == VFFSL(SL,"predicate_name",True): # generated from line 138, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 141, col 30
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 141, col 30.
write('''</option>\r
''')
write(''' </select>\r
<div class="ptext2">\r
''')
if VFFSL(SL,"answer_required",True): # generated from line 145, col 25
write(''' <input id="sqp_answer_required1" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required1\')" checked="y" name="answer_required1"/>\r
''')
else: # generated from line 147, col 25
write(''' <input id="sqp_answer_required1" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required1\')" name="answer_required1"/>\r
''')
write(''' <label for="sqp_answer_required1">Answer is required.</label>\r
</div>\r
</div>\r
<div class="ft"/>\r
</div>\r
</td>\r
</tr>\r
\r
<!-- Question tag answer type -->\r
<tr>\r
<td/>\r
<td>\r
<div id="qdt_tag_module_div">\r
<div class="hd"/>\r
<div class="bd">\r
<div class="ptext1">Select the Tag Category for the answer:<br clear="all" /></div>\r
<select id="sqp_tag_category" name="qcategory" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"category",True) == '': # generated from line 168, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Category</option>\r
''')
for category_index in VFN(VFFSL(SL,"psearch_db",True),"get_categories_iterator",False)(): # generated from line 172, col 25
write(''' <option value ="''')
_v = VFN(VFFSL(SL,"category_index",True),"get_name",False)() # '$category_index.get_name()' on line 173, col 45
if _v is not None: write(_filter(_v, rawExpr='$category_index.get_name()')) # from line 173, col 45.
write('''"\r
''')
if VFFSL(SL,"category",True) == VFN(VFFSL(SL,"category_index",True),"get_name",False)(): # generated from line 174, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFN(VFFSL(SL,"category_index",True),"get_name",False)() # '$category_index.get_name()' on line 177, col 30
if _v is not None: write(_filter(_v, rawExpr='$category_index.get_name()')) # from line 177, col 30.
write('''</option>\r
''')
write(''' </select>\r
\r
<!-- Added 07/10/07 for domain_predicate -->\r
<div class="ptext2">Select the Domain Property associated with this Question:<br clear="all" /></div>\r
<select id="sqp_domain_predicate" name="dpredicate" onchange="enable_button(\'sqp_button\')">\r
<option value ="_none_"\r
''')
if VFFSL(SL,"domain_predicate",True) == '': # generated from line 185, col 25
write(''' selected="selected"\r
''')
write(''' >Select a Domain Property</option>\r
''')
for predicate_name in VFFSL(SL,"all_domain_properties",True): # generated from line 189, col 25
write(''' <option value ="''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 190, col 45
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 190, col 45.
write('''"\r
''')
if VFFSL(SL,"domain_predicate",True) == VFFSL(SL,"predicate_name",True): # generated from line 191, col 29
write(''' selected="selected"\r
''')
write(''' >''')
_v = VFFSL(SL,"predicate_name",True) # '$predicate_name' on line 194, col 30
if _v is not None: write(_filter(_v, rawExpr='$predicate_name')) # from line 194, col 30.
write('''</option>\r
''')
write(''' </select>\r
\r
<div class="ptext2">\r
''')
if VFFSL(SL,"answer_required",True): # generated from line 199, col 25
write(''' <input id="sqp_answer_required2" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required2\')" checked="y" name="answer_required1"/>\r
''')
else: # generated from line 201, col 25
write(''' <input id="sqp_answer_required2" type="checkbox" onclick="toggle_answer_required(\'sqp_answer_required2\')" name="answer_required1"/>\r
''')
write(''' <label class="ptext2" for="sqp_answer_required2">Answer is required.</label>\r
</div>\r
</div>\r
<div class="ft"/>\r
</div>\r
</td>\r
</tr>\r
\r
<!-- Question help -->\r
<tr>\r
<td>\r
<label class="right" for="sqp_help">Help:</label>\r
</td>\r
<td>\r
<textarea id="sqp_help" name="help" class="left" rows="3" cols="50" onclick="enable_button(\'sqp_button\')">''')
_v = VFFSL(SL,"help",True) # '$help' on line 218, col 120
if _v is not None: write(_filter(_v, rawExpr='$help')) # from line 218, col 120.
write('''</textarea>\r
</td>\r
</tr>\r
\r
<!-- Question submit -->\r
<tr>\r
<td></td>\r
<td class="right">\r
<input type="hidden" name="literal_type" id="sqp_literal_type" value="''')
_v = VFFSL(SL,"literal_type",True) # '$literal_type' on line 226, col 83
if _v is not None: write(_filter(_v, rawExpr='$literal_type')) # from line 226, col 83.
write('''"/>\r
<input type="hidden" name="answer_required" id="sqp_answer_required" value="''')
_v = VFFSL(SL,"answer_required",True) # '$answer_required' on line 227, col 89
if _v is not None: write(_filter(_v, rawExpr='$answer_required')) # from line 227, col 89.
write('''"/>\r
<input type="hidden" name="qname" id="sqp_qname" value="''')
_v = VFFSL(SL,"qname",True) # '$qname' on line 228, col 69
if _v is not None: write(_filter(_v, rawExpr='$qname')) # from line 228, col 69.
write('''"/>\r
<input class="dt_button" id="sqp_button" type="button" value="Save Properties" disabled="y" onclick="get_sqp()"/>\r
</td>\r
</tr>\r
</table>\r
\r
<input type="hidden" name="pname" id="bk_pname" value="''')
_v = VFFSL(SL,"page_name",True) # '$page_name' on line 234, col 56
if _v is not None: write(_filter(_v, rawExpr='$page_name')) # from line 234, col 56.
write('''"/>\r
<input class="go_back_button" id="bk_button" type="submit" value="&lt; Back to Page" onclick="do_view_page_details(\'bk_pname\')"/>\r
\r
<input type="hidden" name="iname" id="bk_iname" value="''')
_v = VFFSL(SL,"iw_name",True) # '$iw_name' on line 237, col 56
if _v is not None: write(_filter(_v, rawExpr='$iw_name')) # from line 237, col 56.
write('''"/>\r
<input class="go_back_button" id="bk_iw_button" type="submit" value="&lt; Back to Interview" onclick="do_view_interview(\'bk_iname\')"/>\r
\r
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
##################################################
## CHEETAH GENERATED ATTRIBUTES
_CHEETAH__instanceInitialized = False
_CHEETAH_version = __CHEETAH_version__
_CHEETAH_versionTuple = __CHEETAH_versionTuple__
_CHEETAH_genTime = __CHEETAH_genTime__
_CHEETAH_genTimestamp = __CHEETAH_genTimestamp__
_CHEETAH_src = __CHEETAH_src__
_CHEETAH_srcLastModified = __CHEETAH_srcLastModified__
_mainCheetahMethod_for_PSQuestionDetailsView= 'respond'
## END CLASS DEFINITION
if not hasattr(PSQuestionDetailsView, '_initCheetahAttributes'):
templateAPIClass = getattr(PSQuestionDetailsView, '_CHEETAH_templateClass', Template)
templateAPIClass._addCheetahPlumbingCodeToClass(PSQuestionDetailsView)
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
# For more information visit http://www.CheetahTemplate.org/
##################################################
## if run from command line:
if __name__ == '__main__':
from Cheetah.TemplateCmdLineIface import CmdLineIface
CmdLineIface(templateObj=PSQuestionDetailsView()).run()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.