diff options
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 208c855..d4a73fa 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -29,10 +29,10 @@ import tempfile from textwrap import dedent from ast import literal_eval from .file_utils import extract_files, delete_files -from yaksh.code_server import(submit, - get_result as get_result_from_code_server - ) -from yaksh.settings import SERVER_POOL_PORT +from yaksh.code_server import ( + submit, get_result as get_result_from_code_server +) +from yaksh.settings import SERVER_POOL_PORT, SERVER_HOST_NAME from django.conf import settings from django.forms.models import model_to_dict @@ -330,7 +330,7 @@ class Quiz(models.Model): duration=30, active=True, attempts_allowed=-1, time_between_attempts=0, description='Yaksh Demo quiz', pass_criteria=0, - creator=user + creator=user, instructions="<b>This is a demo quiz.</b>" ) return demo_quiz @@ -1718,7 +1718,7 @@ class AnswerPaper(models.Model): elif question.type == 'code' or question.type == "upload": user_dir = self.user.profile.get_user_dir() - url = 'http://localhost:%s' % server_port + url = '{0}:{1}'.format(SERVER_HOST_NAME, server_port) submit(url, uid, json_data, user_dir) result = {'uid': uid, 'status': 'running'} return result @@ -1753,7 +1753,7 @@ class AnswerPaper(models.Model): server_port=server_port ) if question.type == "code": - url = 'http://localhost:%s' % server_port + url = '{0}:{1}'.format(SERVER_HOST_NAME, server_port) check_result = get_result_from_code_server(url, result['uid'], block=True ) |