Commit 36195f12 authored by LammLukas's avatar LammLukas

Changes load_template in room.py to find templates on win and linux

parent cfa573fc
......@@ -6,13 +6,18 @@ This short script will guide you through the process of writing your own scripts
Author: L. Lamm (lamm@ifam.rwth-aachen.de)
"""
""" Import all necessary packages from /src"""
"""
1. Import all necessary packages
"""
from src.exam import Exam
"""
1. Create a new and empty exam object
2. Create a new exam object
After you have downloaded the list of participants from RWTHOnline, you can use this .csv file
to create your new exam.
"""
ex = Exam()
ex = Exam('./data/example_inputdata.csv')
"""
2. Import information from RWTHOnline file
......@@ -25,7 +30,7 @@ information on:
* Name of the principal examiner
* List of participants
"""
ex.import_data_RWTHOnline('./data/example_inputdata.csv')
#ex.import_data_RWTHOnline('./data/example_inputdata.csv')
"""
3. Assign number of points per task
......
......@@ -7,6 +7,7 @@ from src.exportable import Exportable
from src.exceptions import *
from src.utils import *
import sqlite3
import os, re
class Room(Exportable):
......@@ -47,8 +48,11 @@ class Room(Exportable):
connector.commit()
connector.close()
def load_template(self, id_str, file='./templates/rooms/room_templates.db'):
def load_template(self, id_str, file=None):
"""Load template for room from database"""
if file is None:
basedir = os.path.dirname(os.path.dirname(__file__))
file = os.path.join(basedir, r'templates', r'rooms', r'room_templates.db')
connector = sqlite3.connect(file)
cursor = connector.cursor()
......
from src.exam import *
from src.protocols import Protocol
ex = Exam('../testdata/large_exam_inputdata.csv')
ex = Exam('./tests/testdata/large_exam_inputdata.csv')
ex.Points_per_task = [10, 10, 5, 10]
ex.assign_participants()
prot = Protocol(ex)
prot.make_protocol('./testdata/test_protocol.docx')
prot.make_protocol('./tests/testdata/test_protocol.docx')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment