Ejemplo n.º 1
0
def impl(context, script_name, practice_uid, course_name):
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    practice.delete_script()
    script = Script()
    script.file = "data/" + script_name
    script.practice = practice
    script.save()
Ejemplo n.º 2
0
def impl(context, script_name, practice_uid, course_name):
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(uid=practice_uid, course=course)
    practice.delete_script()
    script = Script()
    script.file="data/"+script_name
    script.practice = practice
    script.save()
Ejemplo n.º 3
0
def load_a_script(course_name, practice_uid, script_file):
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(course=course, uid=practice_uid)
    practice.get_script().delete()
    script = Script()
    script.practice = practice
    script.file = script_file
    script.save()
    return script
Ejemplo n.º 4
0
def load_a_script(course_name, practice_uid, script_file):
    course = Course.objects.get(name=course_name)
    practice = Practice.objects.get(course=course, uid=practice_uid)
    practice.get_script().delete()
    script = Script()
    script.practice = practice
    script.file = script_file
    script.save()
    return script
Ejemplo n.º 5
0
 def testPracticeShouldFeatureSomeWrapperToAccessTheAssociatedScript(self):
     practice = Practice()
     practice.uid = "uid"
     practice.course = self.course
     practice.file = "pathFile"
     practice.deadline = "2012-12-01" 
     practice.save()
     script = Script()
     script.practice = practice
     script.save()
     self.assertEquals(practice.get_script(), script)