hit-moodle / moodle-local_onlinejudge

Online Judge plugin for Moodle 2.7-4.2.
http://cms.hit.edu.cn
GNU General Public License v3.0
120 stars 59 forks source link

请求评测时报错“无效的语言ID:{$a}” #11

Closed alphakm closed 12 years ago

alphakm commented 12 years ago

虚拟机下安装CentOS 5.5 ,php 5.3.3 moodle 2.1.1环境,在线评测设置的编程语言:C (gcc-4.3.4, ideone.com)。请求评测时报错:无效的语言ID:{$a}”。请问如何解决?谢谢!

sunner commented 12 years ago

Please provide full details about the procedure of:

  1. your installation of onlinejudge
  2. how you add the onlinejudge assignment

Thx.

alphakm commented 12 years ago
  1. installing on Linux: 1) Decompress hit-moodle-moodle-local_onlinejudge-2ca62a3, rename it 2) Put onlinejudge into /var/www/html/moodle/local/ 3) run /var/www/html/moodle/local/onlinejudge/cli/install_assignment_type. No error. 4) Login my site as admin and access /admin/index.php. The installation success. 5) run sudo -u apache /usr/bin/php /var/www/html/moodle/local/onlinejudge/cli/judged.php. show "Judge daemon successfully created. PID = 17966"
  2. Login my site as teacher and access My courses--Turn editing on--Weekly outline--Add an activity--Online Judge On Online Judge setting page: 1) Programming language: C (gcc-4.3.4, ideone.com) 2) filling Ideone API by my account and my password 3) Other parts is default
sunner commented 12 years ago

I followed your steps but the problem is not reproduced. Instead, I met another problem since the testcases are not defined. I fixed the problem in the latest code. Can you test it to see whether it fixes your problem also? Thx.

alphakm commented 12 years ago

I download the latest code, Updated the onlinejudge. test it agin, but the problem still occurs. I finded a other thing.: The Student submit online draft, but the teacher judge display "还没有提交文件". I think it may be the cause of the problem.

alphakm commented 12 years ago

By the way, how can i upload a picture? thanks!

sunner commented 12 years ago

Can you post the records in table mdl_assignment_oj_submissions here? Or, can you give me access to your site and database to debug? This is really odd problem and I can't reproduce it.

BTW: github comment does not support uploading pictures. You can upload them to picasa/flicker/others then link them here.

alphakm commented 12 years ago

I just installed CentOS and moodle in my notebook. So do not remote access my stie. I export the recouds in the table mdl_assignment_oj_submissions, as follows:

-- 转存表中的数据 mdl_assignment_oj_submissions

INSERT INTO mdl_assignment_oj_submissions (id, submission, testcase, task, latest) VALUES (1, 2, 1, 1, 0), (2, 1, 1, 2, 1), (3, 2, 1, 3, 1), (4, 3, 2, 4, 1);

sunner commented 12 years ago

Can you post all tables named mdl_assignment_oj* ?

alphakm commented 12 years ago

-- 转存表中的数据 mdl_assignment_oj_testcases

INSERT INTO mdl_assignment_oj_testcases (id, assignment, input, output, usefile, feedback, subgrade, sortorder) VALUES (1, 1, '', 'Let''s begin to learn C programming!', 0, '', '1.0000000000', 0), (2, 2, '10 20', 'Let''s begin to learn C programming!', 0, '继续努力......', '0.7500000000', 0);

alphakm commented 12 years ago

-- 转存表中的数据 mdl_assignment_oj

INSERT INTO mdl_assignment_oj (id, assignment, language, memlimit, cpulimit, compileonly, ratiope, ideoneuser, ideonepass) VALUES (1, 1, '11_ideone', 8388608, 10, 0, '0.3000000000', 'alphakm', 'ynn@5038003&'), (2, 2, '11_ideone', 1048576, 10, 0, '0.5000000000', 'alphakm', 'ynn@5038003&');

sunner commented 12 years ago

I add some restrictness in latest code which should not solve this problem but should be helpful for debuging. Try it and don't forget install_assignment_type

alphakm commented 12 years ago

The Student submit online draft, Submission auto judge without teacher's requesting. 2006002-2.c

Status: Accepted Judge time: Wednesday, 10 August 2011, 10:11 PM (2 mins 6 secs early)

Details: Case 1: Accepted

sunner commented 12 years ago

Oh. So the problem has gone? Ok. Close this issue