Fix: location of reference solution

This commit is contained in:
Tim Schubert 2018-08-23 14:16:23 +02:00
parent 0e86b2adb1
commit 8192944d41

View file

@ -36,7 +36,7 @@ def deadline(gl, args):
deadline_name = args.tag_name deadline_name = args.tag_name
try: try:
reference = gl.projects.get(args.reference, lazy=True) reference = gl.projects.get(args.reference, lazy=False)
try: try:
create_tag(reference, deadline_name, 'master') create_tag(reference, deadline_name, 'master')
@ -58,11 +58,12 @@ def plagiates(gl, args):
"""Runs the plagiarism checker (JPlag) for the solutions with a certain tag """Runs the plagiarism checker (JPlag) for the solutions with a certain tag
""" """
solutions_dir = 'input'
tag = args.tag_name tag = args.tag_name
reference = gl.projects.get(args.reference, lazy=False) reference = gl.projects.get(args.reference, lazy=False)
if not os.path.exists('solutions'): if not os.path.exists(solutions_dir):
os.mkdir('input') os.mkdir(solutions_dir)
os.chdir('input') os.chdir(solutions_dir)
try: try:
subprocess.run( subprocess.run(
['git', 'clone', '--branch', tag, reference.ssh_url_to_repo, reference.path_with_namespace]) ['git', 'clone', '--branch', tag, reference.ssh_url_to_repo, reference.path_with_namespace])
@ -77,7 +78,7 @@ def plagiates(gl, args):
print(e.error_message) print(e.error_message)
os.chdir('..') os.chdir('..')
subprocess.run( subprocess.run(
['java', '-jar', args.jplag_jar, '-s', input, '-p', 'java', '-r', 'results', '-bc', args.reference, '-l', 'java17']) ['java', '-jar', args.jplag_jar, '-s', solutions_dir, '-p', 'java', '-r', 'results', '-bc', args.reference, '-l', 'java17'])
def course(gl, args): def course(gl, args):