From 688f8914e3c7c935f74b900fc7a5f1cfaf0e312f Mon Sep 17 00:00:00 2001 From: kimth Date: Thu, 2 Aug 2012 20:32:03 -0400 Subject: [PATCH] Update filesubmission template to show state --- common/lib/capa/capa/inputtypes.py | 4 ++-- common/lib/capa/capa/templates/filesubmission.html | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index 32ee479414..c3cddf48ed 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -13,6 +13,7 @@ Module containing the problem elements which render into input objects - checkboxgroup - imageinput (for clickable image) - optioninput (for option list) +- filesubmission (upload a file) These are matched by *.html files templates/*.html which are mako templates with the actual html. @@ -306,8 +307,7 @@ def filesubmission(element, value, status, render_template, msg=''): Upload a single file (e.g. for programming assignments) ''' eid = element.get('id') - - context = {'id': eid, } + context = { 'id': eid, 'state': status, 'msg': msg, } html = render_template("filesubmission.html", context) return etree.XML(html) diff --git a/common/lib/capa/capa/templates/filesubmission.html b/common/lib/capa/capa/templates/filesubmission.html index f9073799d4..08f45c916a 100644 --- a/common/lib/capa/capa/templates/filesubmission.html +++ b/common/lib/capa/capa/templates/filesubmission.html @@ -1,3 +1,16 @@

+ % if state == 'unsubmitted': + + % elif state == 'correct': + + % elif state == 'incorrect': + + % elif state == 'incomplete': + + % endif + (${state}) +
+ ${msg|n} +