+ if request.method == 'GET':
+ return render(request, 'wtem/main.html', dict(exercises = exercises))
+ elif request.method == 'POST':
+ form = WTEMForm(request.POST, request.FILES, instance = submission)
+ if form.is_valid():
+ form.save()
+ return render(request, 'wtem/thanks.html')
+ else:
+ raise Exception