按源码运行测试,答题交卷后点确认后没有反应,不出来成绩和排名。 请老师看一下,代码改了没有,或有没有更新,有没有类似情况。
辕 2019-09-23 14:50:05
[23/Sep/2019 11:25:29] "GET /api/questions?csrfmiddlewaretoken=xdKcWg139iTZYP72RDgp40a1cCCQC1uLrCwaHdtR0kaZXfv5V1x8AoHry1G47Gce&uid=ezBEpwbBAPGEe2EThJUrrU&kind_id=WnJoyfkHMA4kQzZiELpFsm HTTP/1.1" 200 25483
Internal Server Error: /api/answer
Traceback (most recent call last):
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\projects\Exam\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "D:\projects\Exam\utils\decorators.py", line 29, in wrapper
return func(request, *args, **kwargs)
File "D:\projects\Exam\utils\decorators.py", line 59, in wrapper
return func(request, *args, **kwargs)
File "D:\Anaconda3\lib\contextlib.py", line 74, in inner
return func(*args, **kwds)
File "D:\projects\Exam\competition\game_views.py", line 108, in submit_answer
total, correct, wrong = check_correct_num(answer) # 检查答题情况
ValueError: too many values to unpack (expected 3)
[23/Sep/2019 11:25:47] "POST /api/answer HTTP/1.1" 500 19308
辕_1534332338 发表于2019-09-23 14:52
辕 2019-09-23 14:50:05
[23/Sep/2019 11:25:29] "GET /api/questions?csrfmiddlewaretoken=xdKcWg139iTZYP72RDgp40a1cCCQC1uLrCwaHdtR0kaZXfv5V1x8AoHry1G47Gce&uid=ezBEpwbBAPGEe2EThJUrrU&kind_id=WnJoyfkHMA4kQzZiELpFsm HTTP/1.1" 200 25483
Internal Server Error: /api/answer
Traceback (most recent call last):
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\projects\Exam\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "D:\projects\Exam\utils\decorators.py", line 29, in wrapper
return func(request, *args, **kwargs)
File "D:\projects\Exam\utils\decorators.py", line 59, in wrapper
return func(request, *args, **kwargs)
File "D:\Anaconda3\lib\contextlib.py", line 74, in inner
return func(*args, **kwds)
File "D:\projects\Exam\competition\game_views.py", line 108, in submit_answer
total, correct, wrong = check_correct_num(answer) # 检查答题情况
ValueError: too many values to unpack (expected 3)
[23/Sep/2019 11:25:47] "POST /api/answer HTTP/1.1" 500 19308
报错代码
下载更新后的源码,重新部署后测试,仍然还是同样的问题,交卷确认后没有反应。但 报错的问题不一样了。麻烦andy老师看看。在exam源码包里没有aip\answer这个文件夹,书中也几次提到这个文件夹,但源码包里没有这个文件夹。andy老师更新后的源码按照配置文件配置后还需要其他设置吗?
报错情况如下:Internal Server Error: /api/answer
Traceback (most recent call last):
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\projects\Exam\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "D:\projects\exam-master\utils\decorators.py", line 29, in wrapper
return func(request, *args, **kwargs)
File "D:\projects\exam-master\utils\decorators.py", line 59, in wrapper
return func(request, *args, **kwargs)
File "D:\Anaconda3\lib\contextlib.py", line 74, in inner
return func(*args, **kwds)
File "D:\projects\exam-master\competition\game_views.py", line 134, in submit_answer
add_to_rank(uid, kind_id, qa_info.score, qa_info.expend_time)
File "D:\projects\exam-master\utils\redis\rrank.py", line 17, in add_to_rank
r.zadd(key, rank_socre, uid)
File "D:\projects\Exam\venv\lib\site-packages\redis\client.py", line 2388, in zadd
for pair in iteritems(mapping):
File "D:\projects\Exam\venv\lib\site-packages\redis\_compat.py", line 110, in iteritems
return iter(x.items())
AttributeError: 'float' object has no attribute 'items'
[26/Sep/2019 15:13:44] "POST /api/answer HTTP/1.1" 500 19449
辕_1534332338 发表于2019-09-26 15:21
下载更新后的源码,重新部署后测试,仍然还是同样的问题,交卷确认后没有反应。但 报错的问题不一样了。麻烦andy老师看看。在exam源码包里没有aip\answer这个文件夹,书中也几次提到这个文件夹,但源码包里没有这个文件夹。andy老师更新后的源码按照配置文件配置后还需要其他设置吗?
报错情况如下:Internal Server Error: /api/answer
Traceback (most recent call last):
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "D:\projects\Exam\venv\lib\site-packages\django\core\handlers\base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "D:\projects\Exam\venv\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "D:\projects\exam-master\utils\decorators.py", line 29, in wrapper
return func(request, *args, **kwargs)
File "D:\projects\exam-master\utils\decorators.py", line 59, in wrapper
return func(request, *args, **kwargs)
File "D:\Anaconda3\lib\contextlib.py", line 74, in inner
return func(*args, **kwds)
File "D:\projects\exam-master\competition\game_views.py", line 134, in submit_answer
add_to_rank(uid, kind_id, qa_info.score, qa_info.expend_time)
File "D:\projects\exam-master\utils\redis\rrank.py", line 17, in add_to_rank
r.zadd(key, rank_socre, uid)
File "D:\projects\Exam\venv\lib\site-packages\redis\client.py", line 2388, in zadd
for pair in iteritems(mapping):
File "D:\projects\Exam\venv\lib\site-packages\redis\_compat.py", line 110, in iteritems
return iter(x.items())
AttributeError: 'float' object has no attribute 'items'
[26/Sep/2019 15:13:44] "POST /api/answer HTTP/1.1" 500 19449
现在这个错误是redis 错误。建议你使用原书中介绍的redis版本。