aboutsummaryrefslogtreecommitdiffstats
path: root/src/pmod/pmod_test/py/pmod_test.py
diff options
context:
space:
mode:
authorpzread <netfirewall@gmail.com>2013-07-12 02:10:18 +0800
committerpzread <netfirewall@gmail.com>2013-07-12 02:10:18 +0800
commit456b6867161c1f1295993c61b3726ff44a3c809e (patch)
treefc904f499a613cc9250e22716764c8ba3059f518 /src/pmod/pmod_test/py/pmod_test.py
parent0d25481f72f12eaf0ccfc3172829f0d138a1143c (diff)
downloadtaiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.gz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.bz2
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.lz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.xz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.zst
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.zip
sqmod_test update. Better way to load css
Diffstat (limited to 'src/pmod/pmod_test/py/pmod_test.py')
-rw-r--r--src/pmod/pmod_test/py/pmod_test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/pmod/pmod_test/py/pmod_test.py b/src/pmod/pmod_test/py/pmod_test.py
index baa5151..33e4a0e 100644
--- a/src/pmod/pmod_test/py/pmod_test.py
+++ b/src/pmod/pmod_test/py/pmod_test.py
@@ -24,6 +24,8 @@ class pmod_test(Problem):
self._reg_path = 'pro/' + str(self._proid) + '/'
Proxy.instance.register_call(
+ self._reg_path, 'view', self.view)
+ Proxy.instance.register_call(
self._reg_path, 'add_mode', self.add_mode)
Proxy.instance.register_call(
self._reg_path, 'del_mode', self.del_mode)
@@ -50,6 +52,8 @@ class pmod_test(Problem):
def unload(self, force):
Proxy.instance.unregister_call(
+ self._reg_path, 'view')
+ Proxy.instance.unregister_call(
self._reg_path, 'add_mode')
Proxy.instance.unregister_call(
self._reg_path, 'del_mode')
@@ -104,6 +108,24 @@ class pmod_test(Problem):
cur.execute(sqlstr, sqlarr)
@imc.async.caller
+ def view(self):
+ with TOJAuth.change_current_iden(self._idendesc):
+ mode = self._get_mode_by_modeid(1)
+
+ if mode == None:
+ return 'Emodeid'
+
+ testmode = self._get_testmode_info(mode['testmodeid'])
+
+ ret = {
+ 'content':mode['content'],
+ 'timelimit':testmode['timelimit'],
+ 'memlimit':testmode['memlimit']
+ }
+
+ return ret
+
+ @imc.async.caller
def add_mode(self, content, testmodeid):
if(
(content != None and type(content) != str) or