From 4f4e9346ff5eda64baedb6197ca52cba22cb77a8 Mon Sep 17 00:00:00 2001 From: Hardik Ghaghada Date: Tue, 31 Jan 2012 18:18:26 +0530 Subject: updated base.html (for new look) --- testapp/templates/base.html | 64 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/testapp/templates/base.html b/testapp/templates/base.html index c2bbabb..54a2035 100644 --- a/testapp/templates/base.html +++ b/testapp/templates/base.html @@ -1,17 +1,76 @@ - +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + {% block title %} {% endblock %} + {% block meta %} + + + {% endblock %} + + {% block css %} + {% endblock %} + {% block script %} {% endblock %} @@ -21,5 +80,6 @@ {% block content %} {% endblock %} + -- cgit From 8c002a7d5fed7f4a452ce9ca1c02638c45310125 Mon Sep 17 00:00:00 2001 From: Hardik Ghaghada Date: Tue, 31 Jan 2012 18:19:21 +0530 Subject: updated login form (new UI) with forgot password link --- testapp/templates/exam/login.html | 47 ++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html index 8e6352e..9420903 100644 --- a/testapp/templates/exam/login.html +++ b/testapp/templates/exam/login.html @@ -3,18 +3,49 @@ {% block title %}Login{% endblock title %} {% block content %} -

Welcome to the Examination. -Please login to proceed.

- + + +
+
+ +
+
+

Login


{% csrf_token %} - + +
{{ form.as_table }} -
+ - +
 
+
Forgot Password?

+
New User? Sign-Up
- -New User Registration +
+
+
+ + +
+ + + + + {% endblock content %} \ No newline at end of file -- cgit From c5ebc8fe0f6dc1f15b490e601ca8c209d940e20c Mon Sep 17 00:00:00 2001 From: Hardik Ghaghada Date: Tue, 31 Jan 2012 18:20:38 +0530 Subject: updated base.css (for the new look) --- testapp/static/exam/css/base.css | 2487 +++++++++++++++++++++++++++++++++++++- 1 file changed, 2462 insertions(+), 25 deletions(-) diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index 1323116..ef5b374 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -1,26 +1,2463 @@ -body { font-family: 'Georgia', serif; font-size: 17px; color: #000; background: #eee;} -h1, h2, h3, h4 { font-family: 'Garamond', 'Georgia', serif; font-weight: normal; } -h1 { margin: 0 0 30px 0; font-size: 36px;} -h1 span { display: none; } -h2 { font-size: 26px; margin: 15px 0 5px 0; } -h3 { font-size: 22px; margin: 15px 0 5px 0; } -h4 { font-size: 15px; margin: 15px 0 5px 0; } - -.box { width: 700px; margin: 10px auto ; } -.page { margin: 2em auto; width: 35em; border: 5px solid #ccc; - padding: 0.8em; background: white; } -.entries { list-style: none; margin: 0; padding: 0; } -.entries li { margin: 0.8em 1.2em; } -.entries li h2 { margin-left: -1em; } -.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; } -.add-entry dl { font-weight: bold; } -.metanav { text-align: right; font-size: 0.8em; padding: 0.3em; - margin-bottom: 1em; background: #fafafa; } -.flash { background: #CEE5F5; padding: 0.5em; - border: 1px solid #AACBE2; } -.error { background: #F0D6D6; padding: 0.5em; } -textarea, code, -pre { font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', - monospace!important; font-size: 14px; background: #eee; } -pre { padding: 0px 30px; margin: 15px -30px; line-height: 1.3; } +html, body { + margin: 0; + padding: 0; +} +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +cite, +code, +del, +dfn, +em, +img, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +dd, +dl, +dt, +li, +ol, +ul, +fieldset, +form, +label, +legend, +button, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td { + margin: 0; + padding: 0; + border: 0; + font-weight: normal; + font-style: normal; + font-size: 100%; + line-height: 1; + font-family: serif; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +ol, ul { + list-style: none; +} +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} +html { + overflow-y: scroll; + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +a:focus { + outline: thin dotted; +} +a:hover, a:active { + outline: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +audio, canvas, video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; +} +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; + -ms-interpolation-mode: bicubic; +} +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +button, input { + line-height: normal; + *overflow: visible; +} +button::-moz-focus-inner, input::-moz-focus-inner { + border: 0; + padding: 0; +} +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} +input[type="search"] { + -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +textarea { + overflow: auto; + vertical-align: top; +} +/* Variables.less +* Variables to customize the look and feel of Bootstrap +* ----------------------------------------------------- */ +/* Mixins.less +* Snippets of reusable CSS to develop faster and keep code readable +* ----------------------------------------------------------------- */ +/* +* Scaffolding +* Basic and global styles for generating a grid system, structural layout, and page templates +* ------------------------------------------------------------------------------------------- */ +body { + background-color: #ffffff; + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 18px; + color: #404040; +} +.container { + width: 940px; + margin-left: auto; + margin-right: auto; + zoom: 1; +} +.container:before, .container:after { + display: table; + content: ""; + zoom: 1; +} +.container:after { + clear: both; +} +.container-fluid { + position: relative; + min-width: 940px; + padding-left: 20px; + padding-right: 20px; + zoom: 1; +} +.container-fluid:before, .container-fluid:after { + display: table; + content: ""; + zoom: 1; +} +.container-fluid:after { + clear: both; +} +.container-fluid > .sidebar { + position: absolute; + top: 0; + left: 20px; + width: 220px; +} +.container-fluid > .content { + margin-left: 240px; +} +a { + color: #0069d6; + text-decoration: none; + line-height: inherit; + font-weight: inherit; +} +a:hover { + color: #00438a; + text-decoration: underline; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.hide { + display: none; +} +.show { + display: block; +} +.row { + zoom: 1; + margin-left: -20px; +} +.row:before, .row:after { + display: table; + content: ""; + zoom: 1; +} +.row:after { + clear: both; +} +.row > [class*="span"] { + display: inline; + float: left; + margin-left: 20px; +} +.span1 { + width: 40px; +} +.span2 { + width: 100px; +} +.span3 { + width: 160px; +} +.span4 { + width: 220px; +} +.span5 { + width: 280px; +} +.span6 { + width: 340px; +} +.span7 { + width: 400px; +} +.span8 { + width: 460px; +} +.span9 { + width: 520px; +} +.span10 { + width: 580px; +} +.span11 { + width: 640px; +} +.span12 { + width: 700px; +} +.span13 { + width: 760px; +} +.span14 { + width: 820px; +} +.span15 { + width: 880px; +} +.span16 { + width: 940px; +} +.span17 { + width: 1000px; +} +.span18 { + width: 1060px; +} +.span19 { + width: 1120px; +} +.span20 { + width: 1180px; +} +.span21 { + width: 1240px; +} +.span22 { + width: 1300px; +} +.span23 { + width: 1360px; +} +.span24 { + width: 1420px; +} +.row > .offset1 { + margin-left: 80px; +} +.row > .offset2 { + margin-left: 140px; +} +.row > .offset3 { + margin-left: 200px; +} +.row > .offset4 { + margin-left: 260px; +} +.row > .offset5 { + margin-left: 320px; +} +.row > .offset6 { + margin-left: 380px; +} +.row > .offset7 { + margin-left: 440px; +} +.row > .offset8 { + margin-left: 500px; +} +.row > .offset9 { + margin-left: 560px; +} +.row > .offset10 { + margin-left: 620px; +} +.row > .offset11 { + margin-left: 680px; +} +.row > .offset12 { + margin-left: 740px; +} +.span-one-third { + width: 300px; +} +.span-two-thirds { + width: 620px; +} +.row > .offset-one-third { + margin-left: 340px; +} +.row > .offset-two-thirds { + margin-left: 660px; +} +/* Typography.less +* Headings, body text, lists, code, and more for a versatile and durable typography system +* ---------------------------------------------------------------------------------------- */ +p { + font-size: 13px; + font-weight: normal; + line-height: 18px; + margin-bottom: 9px; +} +p small { + font-size: 11px; + color: #bfbfbf; +} +h1, +h2, +h3, +h4, +h5, +h6 { + font-weight: bold; + color: #404040; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + color: #bfbfbf; +} +h1 { + margin-bottom: 18px; + font-size: 30px; + line-height: 36px; +} +h1 small { + font-size: 18px; +} +h2 { + font-size: 24px; + line-height: 36px; +} +h2 small { + font-size: 14px; +} +h3, +h4, +h5, +h6 { + line-height: 36px; +} +h3 { + font-size: 18px; +} +h3 small { + font-size: 14px; +} +h4 { + font-size: 16px; +} +h4 small { + font-size: 12px; +} +h5 { + font-size: 14px; +} +h6 { + font-size: 13px; + color: #bfbfbf; + text-transform: uppercase; +} +ul, ol { + margin: 0 0 18px 25px; +} +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} +ul { + list-style: disc; +} +ol { + list-style: decimal; +} +li { + line-height: 18px; + color: #808080; +} +ul.unstyled { + list-style: none; + margin-left: 0; +} +dl { + margin-bottom: 18px; +} +dl dt, dl dd { + line-height: 18px; +} +dl dt { + font-weight: bold; +} +dl dd { + margin-left: 9px; +} +hr { + margin: 20px 0 19px; + border: 0; + border-bottom: 1px solid #eee; +} +strong { + font-style: inherit; + font-weight: bold; +} +em { + font-style: italic; + font-weight: inherit; + line-height: inherit; +} +.muted { + color: #bfbfbf; +} +blockquote { + margin-bottom: 18px; + border-left: 5px solid #eee; + padding-left: 15px; +} +blockquote p { + font-size: 14px; + font-weight: 300; + line-height: 18px; + margin-bottom: 0; +} +blockquote small { + display: block; + font-size: 12px; + font-weight: 300; + line-height: 18px; + color: #bfbfbf; +} +blockquote small:before { + content: '\2014 \00A0'; +} +address { + display: block; + line-height: 18px; + margin-bottom: 18px; +} +code, pre { + padding: 0 3px 2px; + font-family: Monaco, Andale Mono, Courier New, monospace; + font-size: 12px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +code { + background-color: #fee9cc; + color: rgba(0, 0, 0, 0.75); + padding: 1px 3px; +} +pre { + background-color: #f5f5f5; + display: block; + padding: 8.5px; + margin: 0 0 18px; + line-height: 18px; + font-size: 12px; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +/* Forms.less +* Base styles for various input types, form layouts, and states +* ------------------------------------------------------------- */ +form { + margin-bottom: 18px; +} +fieldset { + margin-bottom: 18px; + padding-top: 18px; +} +fieldset legend { + display: block; + padding-left: 150px; + font-size: 19.5px; + line-height: 1; + color: #404040; + *padding: 0 0 5px 145px; + /* IE6-7 */ + + *line-height: 1.5; + /* IE6-7 */ + +} +form .clearfix { + margin-bottom: 18px; + zoom: 1; +} +form .clearfix:before, form .clearfix:after { + display: table; + content: ""; + zoom: 1; +} +form .clearfix:after { + clear: both; +} +label, +input, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: normal; +} +label { + padding-top: 6px; + font-size: 13px; + line-height: 18px; + float: left; + width: 130px; + text-align: left; + color: #404040; +} +form .input { + margin-left: 150px; +} +input[type=checkbox], input[type=radio] { + cursor: pointer; +} +input, +textarea, +select, +.uneditable-input { + display: inline-block; + width: 210px; + height: 18px; + padding: 4px; + font-size: 13px; + line-height: 18px; + color: #808080; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +select { + padding: initial; +} +input[type=checkbox], input[type=radio] { + width: auto; + height: auto; + padding: 0; + margin: 3px 0; + *margin-top: 0; + /* IE6-7 */ + + line-height: normal; + border: none; +} +input[type=file] { + background-color: #ffffff; + padding: initial; + border: initial; + line-height: initial; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +input[type=button], input[type=reset], input[type=submit] { + width: auto; + height: auto; +} +select, input[type=file] { + height: 27px; + *height: auto; + line-height: 27px; + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + +} +select[multiple] { + height: inherit; + background-color: #ffffff; +} +textarea { + height: auto; +} +.uneditable-input { + background-color: #ffffff; + display: block; + border-color: #eee; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + cursor: not-allowed; +} +:-moz-placeholder { + color: #bfbfbf; +} +::-webkit-input-placeholder { + color: #bfbfbf; +} +input, textarea { + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); +} +input:focus, textarea:focus { + outline: 0; + border-color: rgba(82, 168, 236, 0.8); + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); +} +input[type=file]:focus, input[type=checkbox]:focus, select:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + outline: 1px dotted #666; +} +form .clearfix.error > label, form .clearfix.error .help-block, form .clearfix.error .help-inline { + color: #b94a48; +} +form .clearfix.error input, form .clearfix.error textarea { + color: #b94a48; + border-color: #ee5f5b; +} +form .clearfix.error input:focus, form .clearfix.error textarea:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +form .clearfix.error .input-prepend .add-on, form .clearfix.error .input-append .add-on { + color: #b94a48; + background-color: #fce6e6; + border-color: #b94a48; +} +form .clearfix.warning > label, form .clearfix.warning .help-block, form .clearfix.warning .help-inline { + color: #c09853; +} +form .clearfix.warning input, form .clearfix.warning textarea { + color: #c09853; + border-color: #ccae64; +} +form .clearfix.warning input:focus, form .clearfix.warning textarea:focus { + border-color: #be9a3f; + -webkit-box-shadow: 0 0 6px #e5d6b1; + -moz-box-shadow: 0 0 6px #e5d6b1; + box-shadow: 0 0 6px #e5d6b1; +} +form .clearfix.warning .input-prepend .add-on, form .clearfix.warning .input-append .add-on { + color: #c09853; + background-color: #d2b877; + border-color: #c09853; +} +form .clearfix.success > label, form .clearfix.success .help-block, form .clearfix.success .help-inline { + color: #468847; +} +form .clearfix.success input, form .clearfix.success textarea { + color: #468847; + border-color: #57a957; +} +form .clearfix.success input:focus, form .clearfix.success textarea:focus { + border-color: #458845; + -webkit-box-shadow: 0 0 6px #9acc9a; + -moz-box-shadow: 0 0 6px #9acc9a; + box-shadow: 0 0 6px #9acc9a; +} +form .clearfix.success .input-prepend .add-on, form .clearfix.success .input-append .add-on { + color: #468847; + background-color: #bcddbc; + border-color: #468847; +} +.input-mini, +input.mini, +textarea.mini, +select.mini { + width: 60px; +} +.input-small, +input.small, +textarea.small, +select.small { + width: 90px; +} +.input-medium, +input.medium, +textarea.medium, +select.medium { + width: 150px; +} +.input-large, +input.large, +textarea.large, +select.large { + width: 210px; +} +.input-xlarge, +input.xlarge, +textarea.xlarge, +select.xlarge { + width: 270px; +} +.input-xxlarge, +input.xxlarge, +textarea.xxlarge, +select.xxlarge { + width: 530px; +} +textarea.xxlarge { + overflow-y: auto; +} +input.span1, textarea.span1 { + display: inline-block; + float: none; + width: 30px; + margin-left: 0; +} +input.span2, textarea.span2 { + display: inline-block; + float: none; + width: 90px; + margin-left: 0; +} +input.span3, textarea.span3 { + display: inline-block; + float: none; + width: 150px; + margin-left: 0; +} +input.span4, textarea.span4 { + display: inline-block; + float: none; + width: 210px; + margin-left: 0; +} +input.span5, textarea.span5 { + display: inline-block; + float: none; + width: 270px; + margin-left: 0; +} +input.span6, textarea.span6 { + display: inline-block; + float: none; + width: 330px; + margin-left: 0; +} +input.span7, textarea.span7 { + display: inline-block; + float: none; + width: 390px; + margin-left: 0; +} +input.span8, textarea.span8 { + display: inline-block; + float: none; + width: 450px; + margin-left: 0; +} +input.span9, textarea.span9 { + display: inline-block; + float: none; + width: 510px; + margin-left: 0; +} +input.span10, textarea.span10 { + display: inline-block; + float: none; + width: 570px; + margin-left: 0; +} +input.span11, textarea.span11 { + display: inline-block; + float: none; + width: 630px; + margin-left: 0; +} +input.span12, textarea.span12 { + display: inline-block; + float: none; + width: 690px; + margin-left: 0; +} +input.span13, textarea.span13 { + display: inline-block; + float: none; + width: 750px; + margin-left: 0; +} +input.span14, textarea.span14 { + display: inline-block; + float: none; + width: 810px; + margin-left: 0; +} +input.span15, textarea.span15 { + display: inline-block; + float: none; + width: 870px; + margin-left: 0; +} +input.span16, textarea.span16 { + display: inline-block; + float: none; + width: 930px; + margin-left: 0; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + background-color: #f5f5f5; + border-color: #ddd; + cursor: not-allowed; +} +.actions { + background: #f5f5f5; + margin-top: 18px; + margin-bottom: 18px; + padding: 17px 20px 18px 150px; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; +} +.actions .secondary-action { + float: right; +} +.actions .secondary-action a { + line-height: 30px; +} +.actions .secondary-action a:hover { + text-decoration: underline; +} +.help-inline, .help-block { + font-size: 13px; + line-height: 18px; + color: #bfbfbf; +} +.help-inline { + padding-left: 5px; + *position: relative; + /* IE6-7 */ + + *top: -5px; + /* IE6-7 */ + +} +.help-block { + display: block; + max-width: 600px; +} +.inline-inputs { + color: #808080; +} +.inline-inputs span { + padding: 0 2px 0 1px; +} +.input-prepend input, .input-append input { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend .add-on, .input-append .add-on { + position: relative; + background: #f5f5f5; + border: 1px solid #ccc; + z-index: 2; + float: left; + display: block; + width: auto; + min-width: 16px; + height: 18px; + padding: 4px 4px 4px 5px; + margin-right: -1px; + font-weight: normal; + line-height: 18px; + color: #bfbfbf; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend .active, .input-append .active { + background: #a9dba9; + border-color: #46a546; +} +.input-prepend .add-on { + *margin-top: 1px; + /* IE6-7 */ + +} +.input-append input { + float: left; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .add-on { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; + margin-right: 0; + margin-left: -1px; +} +.inputs-list { + margin: 0 0 5px; + width: 100%; +} +.inputs-list li { + display: block; + padding: 0; + width: 100%; +} +.inputs-list label { + display: block; + float: none; + width: auto; + padding: 0; + margin-left: 20px; + line-height: 18px; + text-align: left; + white-space: normal; +} +.inputs-list label strong { + color: #808080; +} +.inputs-list label small { + font-size: 11px; + font-weight: normal; +} +.inputs-list .inputs-list { + margin-left: 25px; + margin-bottom: 10px; + padding-top: 0; +} +.inputs-list:first-child { + padding-top: 6px; +} +.inputs-list li + li { + padding-top: 2px; +} +.inputs-list input[type=radio], .inputs-list input[type=checkbox] { + margin-bottom: 0; + margin-left: -20px; + float: left; +} +.form-stacked { + padding-left: 20px; +} +.form-stacked fieldset { + padding-top: 9px; +} +.form-stacked legend { + padding-left: 0; +} +.form-stacked label { + display: block; + float: none; + width: auto; + font-weight: bold; + text-align: left; + line-height: 20px; + padding-top: 0; +} +.form-stacked .clearfix { + margin-bottom: 9px; +} +.form-stacked .clearfix div.input { + margin-left: 0; +} +.form-stacked .inputs-list { + margin-bottom: 0; +} +.form-stacked .inputs-list li { + padding-top: 0; +} +.form-stacked .inputs-list li label { + font-weight: normal; + padding-top: 0; +} +.form-stacked div.clearfix.error { + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + margin-top: 0; + margin-left: -10px; +} +.form-stacked .actions { + margin-left: -20px; + padding-left: 20px; +} +/* +* Tables.less +* Tables for, you guessed it, tabular data +* ---------------------------------------- */ +table { + width: 100%; + margin-bottom: 18px; + padding: 0; + font-size: 13px; + border-collapse: collapse; +} +table th, table td { + padding: 10px 10px 9px; + line-height: 18px; + text-align: center; +} +table th { + padding-top: 9px; + font-weight: bold; + vertical-align: middle; +} +table td { + vertical-align: top; + /*border-top: 1px solid #ddd;*/ +} +table tbody th { +/* border-top: 1px solid #ddd;*/ + vertical-align: top; +} +.condensed-table th, .condensed-table td { + padding: 5px 5px 4px; +} +.bordered-table { + border: 1px solid #ddd; + border-collapse: separate; + *border-collapse: collapse; + /* IE7, collapse table to remove spacing */ + + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.bordered-table th + th, .bordered-table td + td, .bordered-table th + td { + border-left: 1px solid #ddd; +} +.bordered-table thead tr:first-child th:first-child, .bordered-table tbody tr:first-child td:first-child { + -webkit-border-radius: 4px 0 0 0; + -moz-border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; +} +.bordered-table thead tr:first-child th:last-child, .bordered-table tbody tr:first-child td:last-child { + -webkit-border-radius: 0 4px 0 0; + -moz-border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; +} +.bordered-table tbody tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; +} +.bordered-table tbody tr:last-child td:last-child { + -webkit-border-radius: 0 0 4px 0; + -moz-border-radius: 0 0 4px 0; + border-radius: 0 0 4px 0; +} +table .span1 { + width: 20px; +} +table .span2 { + width: 60px; +} +table .span3 { + width: 100px; +} +table .span4 { + width: 140px; +} +table .span5 { + width: 180px; +} +table .span6 { + width: 220px; +} +table .span7 { + width: 260px; +} +table .span8 { + width: 300px; +} +table .span9 { + width: 340px; +} +table .span10 { + width: 380px; +} +table .span11 { + width: 420px; +} +table .span12 { + width: 460px; +} +table .span13 { + width: 500px; +} +table .span14 { + width: 540px; +} +table .span15 { + width: 580px; +} +table .span16 { + width: 620px; +} +.zebra-striped tbody tr:nth-child(odd) td, .zebra-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +.zebra-striped tbody tr:hover td, .zebra-striped tbody tr:hover th { + background-color: #f5f5f5; +} +table .header { + cursor: pointer; +} +table .header:after { + content: ""; + float: right; + margin-top: 7px; + border-width: 0 4px 4px; + border-style: solid; + border-color: #000 transparent; + visibility: hidden; +} +table .headerSortUp, table .headerSortDown { + background-color: rgba(141, 192, 219, 0.25); + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); +} +table .header:hover:after { + visibility: visible; +} +table .headerSortDown:after, table .headerSortDown:hover:after { + visibility: visible; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +table .headerSortUp:after { + border-bottom: none; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000; + visibility: visible; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + filter: alpha(opacity=60); + -khtml-opacity: 0.6; + -moz-opacity: 0.6; + opacity: 0.6; +} +table .blue { + color: #049cdb; + border-bottom-color: #049cdb; +} +table .headerSortUp.blue, table .headerSortDown.blue { + background-color: #ade6fe; +} +table .green { + color: #46a546; + border-bottom-color: #46a546; +} +table .headerSortUp.green, table .headerSortDown.green { + background-color: #cdeacd; +} +table .red { + color: #9d261d; + border-bottom-color: #9d261d; +} +table .headerSortUp.red, table .headerSortDown.red { + background-color: #f4c8c5; +} +table .yellow { + color: #ffc40d; + border-bottom-color: #ffc40d; +} +table .headerSortUp.yellow, table .headerSortDown.yellow { + background-color: #fff6d9; +} +table .orange { + color: #f89406; + border-bottom-color: #f89406; +} +.center1 +{ +margin-left: auto; +margin-right: auto; +} +table .headerSortUp.orange, table .headerSortDown.orange { + background-color: #fee9cc; +} +table .purple { + color: #7a43b6; + border-bottom-color: #7a43b6; +} +table .headerSortUp.purple, table .headerSortDown.purple { + background-color: #e2d5f0; +} +/* Patterns.less +* Repeatable UI elements outside the base styles provided from the scaffolding +* ---------------------------------------------------------------------------- */ +.topbar { + height: 40px; + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 10000; + overflow: visible; +} +.topbar a { + color: #bfbfbf; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.topbar h3 a:hover, .topbar .brand:hover, .topbar ul .active > a { + background-color: #333; + background-color: rgba(255, 255, 255, 0.05); + color: #ffffff; + text-decoration: none; +} +.topbar h3 { + position: relative; +} +.topbar h3 a, .topbar .brand { + float: left; + display: block; + padding: 8px 20px 12px; + margin-left: -20px; + color: #ffffff; + font-size: 20px; + font-weight: 200; + line-height: 1; +} +.topbar p { + margin: 0; + line-height: 40px; +} +.topbar p a:hover { + background-color: transparent; + color: #ffffff; +} +.topbar form { + float: left; + margin: 5px 0 0 0; + position: relative; + filter: alpha(opacity=100); + -khtml-opacity: 1; + -moz-opacity: 1; + opacity: 1; +} +.topbar form.pull-right { + float: right; +} +.topbar input { + background-color: #444; + background-color: rgba(255, 255, 255, 0.3); + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: normal; + font-weight: 13px; + line-height: 1; + padding: 4px 9px; + color: #ffffff; + color: rgba(255, 255, 255, 0.75); + border: 1px solid #111; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25); + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; +} +.topbar input:-moz-placeholder { + color: #e6e6e6; +} +.topbar input::-webkit-input-placeholder { + color: #e6e6e6; +} +.topbar input:hover { + background-color: #bfbfbf; + background-color: rgba(255, 255, 255, 0.5); + color: #ffffff; +} +.topbar input:focus, .topbar input.focused { + outline: 0; + background-color: #ffffff; + color: #404040; + text-shadow: 0 1px 0 #ffffff; + border: 0; + padding: 5px 10px; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); +} +.topbar-inner, .topbar .fill { + background-color: #222; + background-color: #222222; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); +} +.topbar div > ul, .nav { + display: block; + float: left; + margin: 0 10px 0 0; + position: relative; + left: 0; +} +.topbar div > ul > li, .nav > li { + display: block; + float: left; +} +.topbar div > ul a, .nav a { + display: block; + float: none; + padding: 10px 10px 11px; + line-height: 19px; + text-decoration: none; +} +.topbar div > ul a:hover, .nav a:hover { + color: #ffffff; + text-decoration: none; +} +.topbar div > ul .active > a, .nav .active > a { + background-color: #222; + background-color: rgba(0, 0, 0, 0.5); +} +.topbar div > ul.secondary-nav, .nav.secondary-nav { + float: right; + margin-left: 10px; + margin-right: 0; +} +.topbar div > ul.secondary-nav .menu-dropdown, +.nav.secondary-nav .menu-dropdown, +.topbar div > ul.secondary-nav .dropdown-menu, +.nav.secondary-nav .dropdown-menu { + right: 0; + border: 0; +} +.topbar div > ul a.menu:hover, +.nav a.menu:hover, +.topbar div > ul li.open .menu, +.nav li.open .menu, +.topbar div > ul .dropdown-toggle:hover, +.nav .dropdown-toggle:hover, +.topbar div > ul .dropdown.open .dropdown-toggle, +.nav .dropdown.open .dropdown-toggle { + background: #444; + background: rgba(255, 255, 255, 0.05); +} +.topbar div > ul .menu-dropdown, +.nav .menu-dropdown, +.topbar div > ul .dropdown-menu, +.nav .dropdown-menu { + background-color: #333; +} +.topbar div > ul .menu-dropdown a.menu, +.nav .menu-dropdown a.menu, +.topbar div > ul .dropdown-menu a.menu, +.nav .dropdown-menu a.menu, +.topbar div > ul .menu-dropdown .dropdown-toggle, +.nav .menu-dropdown .dropdown-toggle, +.topbar div > ul .dropdown-menu .dropdown-toggle, +.nav .dropdown-menu .dropdown-toggle { + color: #ffffff; +} +.topbar div > ul .menu-dropdown a.menu.open, +.nav .menu-dropdown a.menu.open, +.topbar div > ul .dropdown-menu a.menu.open, +.nav .dropdown-menu a.menu.open, +.topbar div > ul .menu-dropdown .dropdown-toggle.open, +.nav .menu-dropdown .dropdown-toggle.open, +.topbar div > ul .dropdown-menu .dropdown-toggle.open, +.nav .dropdown-menu .dropdown-toggle.open { + background: #444; + background: rgba(255, 255, 255, 0.05); +} +.topbar div > ul .menu-dropdown li a, +.nav .menu-dropdown li a, +.topbar div > ul .dropdown-menu li a, +.nav .dropdown-menu li a { + color: #999; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); +} +.topbar div > ul .menu-dropdown li a:hover, +.nav .menu-dropdown li a:hover, +.topbar div > ul .dropdown-menu li a:hover, +.nav .dropdown-menu li a:hover { + background-color: #191919; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #292929), color-stop(100%, #191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(top, #292929, #191919); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#191919', GradientType=0); + color: #ffffff; +} +.topbar div > ul .menu-dropdown .active a, +.nav .menu-dropdown .active a, +.topbar div > ul .dropdown-menu .active a, +.nav .dropdown-menu .active a { + color: #ffffff; +} +.topbar div > ul .menu-dropdown .divider, +.nav .menu-dropdown .divider, +.topbar div > ul .dropdown-menu .divider, +.nav .dropdown-menu .divider { + background-color: #222; + border-color: #444; +} +.topbar ul .menu-dropdown li a, .topbar ul .dropdown-menu li a { + padding: 4px 15px; +} +li.menu, .dropdown { + position: relative; +} +a.menu:after, .dropdown-toggle:after { + width: 0; + height: 0; + display: inline-block; + content: "↓"; + text-indent: -99999px; + vertical-align: top; + margin-top: 8px; + margin-left: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #ffffff; + filter: alpha(opacity=50); + -khtml-opacity: 0.5; + -moz-opacity: 0.5; + opacity: 0.5; +} +.menu-dropdown, .dropdown-menu { + background-color: #ffffff; + float: left; + display: none; + position: absolute; + top: 40px; + z-index: 900; + min-width: 160px; + max-width: 220px; + _width: 160px; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + zoom: 1; + border-color: #999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.menu-dropdown li, .dropdown-menu li { + float: none; + display: block; + background-color: none; +} +.menu-dropdown .divider, .dropdown-menu .divider { + height: 1px; + margin: 5px 0; + overflow: hidden; + background-color: #eee; + border-bottom: 1px solid #ffffff; +} +.topbar .dropdown-menu a, .dropdown-menu a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #808080; + text-shadow: 0 1px 0 #ffffff; +} +.topbar .dropdown-menu a:hover, +.dropdown-menu a:hover, +.topbar .dropdown-menu a.hover, +.dropdown-menu a.hover { + background-color: #dddddd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#eeeeee), to(#dddddd)); + background-image: -moz-linear-gradient(top, #eeeeee, #dddddd); + background-image: -ms-linear-gradient(top, #eeeeee, #dddddd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eeeeee), color-stop(100%, #dddddd)); + background-image: -webkit-linear-gradient(top, #eeeeee, #dddddd); + background-image: -o-linear-gradient(top, #eeeeee, #dddddd); + background-image: linear-gradient(top, #eeeeee, #dddddd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#dddddd', GradientType=0); + color: #404040; + text-decoration: none; + -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.025), inset 0 -1px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.025), inset 0 -1px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.025), inset 0 -1px rgba(0, 0, 0, 0.025); +} +.open .menu, +.dropdown.open .menu, +.open .dropdown-toggle, +.dropdown.open .dropdown-toggle { + color: #ffffff; + background: #ccc; + background: rgba(0, 0, 0, 0.3); +} +.open .menu-dropdown, +.dropdown.open .menu-dropdown, +.open .dropdown-menu, +.dropdown.open .dropdown-menu { + display: block; +} +.tabs, .pills { + margin: 0 0 18px; + padding: 0; + list-style: none; + zoom: 1; +} +.tabs:before, +.pills:before, +.tabs:after, +.pills:after { + display: table; + content: ""; + zoom: 1; +} +.tabs:after, .pills:after { + clear: both; +} +.tabs > li, .pills > li { + float: left; +} +.tabs > li > a, .pills > li > a { + display: block; +} +.tabs { + border-color: #ddd; + border-style: solid; + border-width: 0 0 1px; +} +.tabs > li { + position: relative; + margin-bottom: -1px; +} +.tabs > li > a { + padding: 0 15px; + margin-right: 2px; + line-height: 34px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.tabs > li > a:hover { + text-decoration: none; + background-color: #eee; + border-color: #eee #eee #ddd; +} +.tabs .active > a, .tabs .active > a:hover { + color: #808080; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; + cursor: default; +} +.tabs .menu-dropdown, .tabs .dropdown-menu { + top: 35px; + border-width: 1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; +} +.tabs a.menu:after, .tabs .dropdown-toggle:after { + border-top-color: #999; + margin-top: 15px; + margin-left: 5px; +} +.tabs li.open.menu .menu, .tabs .open.dropdown .dropdown-toggle { + border-color: #999; +} +.tabs li.open a.menu:after, .tabs .dropdown.open .dropdown-toggle:after { + border-top-color: #555; +} +.pills a { + margin: 5px 3px 5px 0; + padding: 0 15px; + line-height: 30px; + text-shadow: 0 1px 1px #ffffff; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.pills a:hover { + color: #ffffff; + text-decoration: none; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); + background-color: #00438a; +} +.pills .active a { + color: #ffffff; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); + background-color: #0069d6; +} +.pills-vertical > li { + float: none; +} +.tab-content > .tab-pane, +.pill-content > .pill-pane, +.tab-content > div, +.pill-content > div { + display: none; +} +.tab-content > .active, .pill-content > .active { + display: block; +} +.breadcrumb { + padding: 7px 14px; + margin: 0 0 18px; + background-color: #f5f5f5; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5)); + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5)); + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); + background-image: linear-gradient(top, #ffffff, #f5f5f5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); + border: 1px solid #ddd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} +.breadcrumb li { + display: inline; + text-shadow: 0 1px 0 #ffffff; +} +.breadcrumb .divider { + padding: 0 5px; + color: #bfbfbf; +} +.breadcrumb .active a { + color: #404040; +} +.hero-unit { + background-color: #f5f5f5; + margin-bottom: 30px; + padding: 60px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.hero-unit h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; +} +.hero-unit p { + font-size: 18px; + font-weight: 200; + line-height: 27px; +} +footer { + margin-top: 17px; + padding-top: 17px; + border-top: 1px solid #eee; +} +.page-header { + margin-bottom: 17px; + border-bottom: 1px solid #ddd; + -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.page-header h1 { + margin-bottom: 8px; +} +.btn.danger, +.alert-message.danger, +.btn.danger:hover, +.alert-message.danger:hover, +.btn.error, +.alert-message.error, +.btn.error:hover, +.alert-message.error:hover, +.btn.success, +.alert-message.success, +.btn.success:hover, +.alert-message.success:hover, +.btn.info, +.alert-message.info, +.btn.info:hover, +.alert-message.info:hover { + color: #ffffff; +} +.btn .close, .alert-message .close { + font-family: Arial, sans-serif; + line-height: 18px; +} +.btn.danger, +.alert-message.danger, +.btn.error, +.alert-message.error { + background-color: #c43c35; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35)); + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(top, #ee5f5b, #c43c35); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #c43c35 #c43c35 #882a25; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.btn.success, .alert-message.success { + background-color: #57a957; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957)); + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -ms-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(top, #62c462, #57a957); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #57a957 #57a957 #3d773d; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.btn.info, .alert-message.info { + background-color: #339bb9; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de), to(#339bb9)); + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de), color-stop(100%, #339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(top, #5bc0de, #339bb9); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #339bb9 #339bb9 #22697d; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.btn { + cursor: pointer; + display: inline-block; + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + padding: 5px 14px 6px; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + color: #333; + font-size: 13px; + line-height: normal; + border: 1px solid #ccc; + border-bottom-color: #bbb; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -webkit-transition: 0.1s linear all; + -moz-transition: 0.1s linear all; + -ms-transition: 0.1s linear all; + -o-transition: 0.1s linear all; + transition: 0.1s linear all; +} +.btn:hover { + background-position: 0 -15px; + color: #333; + text-decoration: none; +} +.btn:focus { + outline: 1px dotted #666; +} +.btn.primary { + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.btn.active, .btn:active { + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn.disabled { + cursor: default; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + filter: alpha(opacity=65); + -khtml-opacity: 0.65; + -moz-opacity: 0.65; + opacity: 0.65; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn[disabled] { + cursor: default; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + filter: alpha(opacity=65); + -khtml-opacity: 0.65; + -moz-opacity: 0.65; + opacity: 0.65; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn.large { + font-size: 15px; + line-height: normal; + padding: 9px 14px 9px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.btn.small { + padding: 7px 9px 7px; + font-size: 11px; +} +:root .alert-message, :root .btn { + border-radius: 0 \0; +} +button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { + padding: 0; + border: 0; +} +.close { + float: right; + color: #000000; + font-size: 20px; + font-weight: bold; + line-height: 13.5px; + text-shadow: 0 1px 0 #ffffff; + filter: alpha(opacity=25); + -khtml-opacity: 0.25; + -moz-opacity: 0.25; + opacity: 0.25; +} +.close:hover { + color: #000000; + text-decoration: none; + filter: alpha(opacity=40); + -khtml-opacity: 0.4; + -moz-opacity: 0.4; + opacity: 0.4; +} +.alert-message { + position: relative; + padding: 7px 15px; + margin-bottom: 18px; + color: #404040; + background-color: #eedc94; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94)); + background-image: -moz-linear-gradient(top, #fceec1, #eedc94); + background-image: -ms-linear-gradient(top, #fceec1, #eedc94); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94)); + background-image: -webkit-linear-gradient(top, #fceec1, #eedc94); + background-image: -o-linear-gradient(top, #fceec1, #eedc94); + background-image: linear-gradient(top, #fceec1, #eedc94); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #eedc94 #eedc94 #e4c652; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + border-width: 1px; + border-style: solid; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); +} +.alert-message .close { + margin-top: 1px; + *margin-top: 0; +} +.alert-message a { + font-weight: bold; + color: #404040; +} +.alert-message.danger p a, +.alert-message.error p a, +.alert-message.success p a, +.alert-message.info p a { + color: #ffffff; +} +.alert-message h5 { + line-height: 18px; +} +.alert-message p { + margin-bottom: 0; +} +.alert-message div { + margin-top: 5px; + margin-bottom: 2px; + line-height: 28px; +} +.alert-message .btn { + -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); + -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); +} +.alert-message.block-message { + background-image: none; + background-color: #fdf5d9; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + padding: 14px; + border-color: #fceec1; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.alert-message.block-message ul, .alert-message.block-message p { + margin-right: 30px; +} +.alert-message.block-message ul { + margin-bottom: 0; +} +.alert-message.block-message li { + color: #404040; +} +.alert-message.block-message .alert-actions { + margin-top: 5px; +} +.alert-message.block-message.error, .alert-message.block-message.success, .alert-message.block-message.info { + color: #404040; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.alert-message.block-message.error { + background-color: #fddfde; + border-color: #fbc7c6; +} +.alert-message.block-message.success { + background-color: #d1eed1; + border-color: #bfe7bf; +} +.alert-message.block-message.info { + background-color: #ddf4fb; + border-color: #c6edf9; +} +.alert-message.block-message.danger p a, +.alert-message.block-message.error p a, +.alert-message.block-message.success p a, +.alert-message.block-message.info p a { + color: #404040; +} +.pagination { + height: 36px; + margin: 18px 0; +} +.pagination ul { + float: left; + margin: 0; + border: 1px solid #ddd; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.pagination li { + display: inline; +} +.pagination a { + float: left; + padding: 0 14px; + line-height: 34px; + border-right: 1px solid; + border-right-color: #ddd; + border-right-color: rgba(0, 0, 0, 0.15); + *border-right-color: #ddd; + /* IE6-7 */ + + text-decoration: none; +} +.pagination a:hover, .pagination .active a { + background-color: #c7eefe; +} +.pagination .disabled a, .pagination .disabled a:hover { + background-color: transparent; + color: #bfbfbf; +} +.pagination .next a { + border: 0; +} +.well { + background-color: #f5f5f5; + margin-bottom: 20px; + padding: 19px; + min-height: 20px; + border: 1px solid #eee; + border: 1px solid rgba(0, 0, 0, 0.05); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.modal-backdrop { + background-color: #000000; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 10000; +} +.modal-backdrop.fade { + opacity: 0; +} +.modal-backdrop, .modal-backdrop.fade.in { + filter: alpha(opacity=80); + -khtml-opacity: 0.8; + -moz-opacity: 0.8; + opacity: 0.8; +} +.modal { + position: fixed; + top: 50%; + left: 50%; + z-index: 11000; + max-height: 500px; + overflow: auto; + width: 560px; + margin: -250px 0 0 -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + /* IE6-7 */ + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.modal .close { + margin-top: 7px; +} +.modal.fade { + -webkit-transition: opacity .3s linear, top .3s ease-out; + -moz-transition: opacity .3s linear, top .3s ease-out; + -ms-transition: opacity .3s linear, top .3s ease-out; + -o-transition: opacity .3s linear, top .3s ease-out; + transition: opacity .3s linear, top .3s ease-out; + top: -25%; +} +.modal.fade.in { + top: 50%; +} +.modal-header { + border-bottom: 1px solid #eee; + padding: 5px 15px; +} +.modal-body { + padding: 15px; +} +.modal-body form { + margin-bottom: 0; +} +.modal-footer { + background-color: #f5f5f5; + padding: 14px 15px 15px; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; + zoom: 1; + margin-bottom: 0; +} +.modal-footer:before, .modal-footer:after { + display: table; + content: ""; + zoom: 1; +} +.modal-footer:after { + clear: both; +} +.modal-footer .btn { + float: right; + margin-left: 5px; +} +.modal .popover, .modal .twipsy { + z-index: 12000; +} +.twipsy { + display: block; + position: absolute; + visibility: visible; + padding: 5px; + font-size: 11px; + z-index: 1000; + filter: alpha(opacity=80); + -khtml-opacity: 0.8; + -moz-opacity: 0.8; + opacity: 0.8; +} +.twipsy.fade.in { + filter: alpha(opacity=80); + -khtml-opacity: 0.8; + -moz-opacity: 0.8; + opacity: 0.8; +} +.twipsy.above .twipsy-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.twipsy.left .twipsy-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.twipsy.below .twipsy-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.twipsy.right .twipsy-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.twipsy-inner { + padding: 3px 8px; + background-color: #000000; + color: white; + text-align: center; + max-width: 200px; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.twipsy-arrow { + position: absolute; + width: 0; + height: 0; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1000; + padding: 5px; + display: none; +} +.popover.above .arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.popover.right .arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.popover.below .arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.popover.left .arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.popover .arrow { + position: absolute; + width: 0; + height: 0; +} +.popover .inner { + background: #000000; + background: rgba(0, 0, 0, 0.8); + padding: 3px; + overflow: hidden; + width: 280px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); +} +.popover .title { + background-color: #f5f5f5; + padding: 9px 15px; + line-height: 1; + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; + border-bottom: 1px solid #eee; +} +.popover .content { + background-color: #ffffff; + padding: 14px; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.popover .content p, .popover .content ul, .popover .content ol { + margin-bottom: 0; +} +.fade { + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -ms-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; + opacity: 0; +} +.fade.in { + opacity: 1; +} +.label { + padding: 1px 3px 2px; + font-size: 9.75px; + font-weight: bold; + color: #ffffff; + text-transform: uppercase; + white-space: nowrap; + background-color: #bfbfbf; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + text-shadow: none; +} +.label.important { + background-color: #c43c35; +} +.label.warning { + background-color: #f89406; +} +.label.success { + background-color: #46a546; +} +.label.notice { + background-color: #62cffc; +} +.media-grid { + margin-left: -20px; + margin-bottom: 0; + zoom: 1; +} +.media-grid:before, .media-grid:after { + display: table; + content: ""; + zoom: 1; +} +.media-grid:after { + clear: both; +} +.media-grid li { + display: inline; +} +.media-grid a { + float: left; + padding: 4px; + margin: 0 0 18px 20px; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); +} +.media-grid a img { + display: block; +} +.media-grid a:hover { + border-color: #0069d6; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} -- cgit From cfe90f043d387fbca3d2312f14819133d668a59b Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Tue, 31 Jan 2012 19:05:38 +0530 Subject: Updated register.html with new look --- testapp/templates/exam/register.html | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/testapp/templates/exam/register.html b/testapp/templates/exam/register.html index 921e7b5..a90f21c 100644 --- a/testapp/templates/exam/register.html +++ b/testapp/templates/exam/register.html @@ -3,15 +3,37 @@ {% block title %}Registration form {% endblock %} {% block content %} -Please provide the following details. + + +
+
+ +
+
+

Please fill in the following details


+
{% csrf_token %} - -{{ form.as_table }} -
- +
+{{ form.as_table }} +
+
  
+
+
+
+ + + +
+ + + -{% endblock content %} \ No newline at end of file +{% endblock content %} -- cgit From 1a3ce22d9397a1fc95dcf99fc424a47f3fc660f7 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Tue, 31 Jan 2012 19:08:00 +0530 Subject: Updated Question.html with new looks --- testapp/templates/exam/question.html | 60 ++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html index 8b589b6..eeb78c3 100644 --- a/testapp/templates/exam/question.html +++ b/testapp/templates/exam/question.html @@ -1,10 +1,12 @@ {% extends "base.html" %} - -{% block title %} Answer question {% endblock %} + + + + {% block title %} Answer question {% endblock %} {% block script %} {% endblock script %} - -{% block onload %} onload="update_time()" {% endblock %} + + +{% block onload %} onload="update_time()" {% endblock onload %} {% block content %} -

{{ question.summary }}

-

{{ question.description|safe }} -
-(Marks: {{ question.points }})

+
+ +
+ +
+
-{% if error_message %}

ERROR:

{{ error_message }}
{% endif %} +

{{ question.summary }}

+
{{ question.description|safe }}
+
(Marks : {{ question.points }})
+ + +{% if error_message %}
ERROR:
{{ error_message }}
{% endif %}

@@ -65,27 +77,29 @@ function update_time() {{option}}
{% endfor %} {% else %} - + {% endif %} -
+ {% if question.type == "mcq" %} - +
   + {% else %} - +   + {% endif %} - + + -

{{ user.first_name.title }} {{ user.last_name.title }}, -you have {{ paper.questions_left }} question(s) left in {{ quiz_name }}.

+
{{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }}
-

Time left:

+

Time left:


{% csrf_token %} - + +
- + {% endblock content %} -- cgit From e7f3f0436555251577f61c93f2e7c1a99c9028a1 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Tue, 31 Jan 2012 19:45:00 +0530 Subject: Updated forms.py to handle and exception when username or password fields are kept blank --- testapp/exam/forms.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index a5ca26f..d99a04d 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -85,8 +85,11 @@ class UserLoginForm(forms.Form): def clean(self): super(UserLoginForm, self).clean() - u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"] - user = authenticate(username = u_name, password = pwd) + try: + u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"] + user = authenticate(username = u_name, password = pwd) + except Exception: + raise forms.ValidationError("Username and/or Password is not entered") if not user: raise forms.ValidationError("Invalid username/password") -- cgit From 20346cca57a525c155fdd7f18253689c68645efd Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Wed, 1 Feb 2012 10:31:51 +0530 Subject: Updated html file with new look --- testapp/templates/exam/complete.html | 26 ++++++++++++++++++++++---- testapp/templates/exam/question.html | 5 +++++ testapp/templates/exam/quit.html | 33 ++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/testapp/templates/exam/complete.html b/testapp/templates/exam/complete.html index 4c3f3d5..6790ea1 100644 --- a/testapp/templates/exam/complete.html +++ b/testapp/templates/exam/complete.html @@ -3,10 +3,28 @@ {% block title %}Good bye!{% endblock %} {% block content %} -

Good bye!

-

{{message}}

-
-

You may now close the browser.

+ + +
+
+ +
+
+

Good bye!

+ +

{{message}}

+ +

You may now close the browser.

+ +
+
+

© FOSSEE group, IIT Bombay

+
+
+ + {% endblock content %} diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html index eeb78c3..d843981 100644 --- a/testapp/templates/exam/question.html +++ b/testapp/templates/exam/question.html @@ -101,5 +101,10 @@ function update_time() +
+ +
{% endblock content %} diff --git a/testapp/templates/exam/quit.html b/testapp/templates/exam/quit.html index 37b5c08..c31fd87 100644 --- a/testapp/templates/exam/quit.html +++ b/testapp/templates/exam/quit.html @@ -2,13 +2,36 @@ {% block title %}Quit exam {% endblock %} + + {% block content %} -

Your current answers are saved.

-

Are you sure you wish to quit the exam?

+ +
+
+ +
+
+ + +

Your current answers are saved.

+

Are you sure you wish to quit the exam?

{% csrf_token %} - - + + +
 
+
-{% endblock content %} \ No newline at end of file +
+
+
+ +
+ + +{% endblock content %} -- cgit From 5aa7fb163af95c27bb3aea4a1dee75ef406e0582 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 1 Feb 2012 10:32:30 +0530 Subject: Updated Introduction form with new look --- testapp/templates/exam/intro.html | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/testapp/templates/exam/intro.html b/testapp/templates/exam/intro.html index 1d3e5de..2306fb7 100644 --- a/testapp/templates/exam/intro.html +++ b/testapp/templates/exam/intro.html @@ -3,7 +3,16 @@ {% block title %}Instructions and Rules {% endblock %} {% block content %} -

Important rules and instructions

+ + +
+
+ +
+
+

Important instructions & rules


Welcome {{user.first_name.title}} {{user.last_name.title}}, to the programming quiz!

@@ -43,11 +52,23 @@ carefully. -

We hope you enjoy taking this exam.

+

We hope you enjoy taking this exam !!!

{% csrf_token %} - +
+
+
+
+
+ -{% endblock content %} \ No newline at end of file +
+ + + + +{% endblock content %} -- cgit From 6809186e406f96fa321b55060364bcaf7bfc4a99 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 2 Feb 2012 12:39:30 +0530 Subject: Updated user_data and grade_user forms (new UI) --- testapp/templates/exam/grade_user.html | 31 ++++++++++++++++++++++++++----- testapp/templates/exam/user_data.html | 24 +++++++++++++++++++++++- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 75ed2e0..2237475 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -3,8 +3,17 @@ {% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %} {% block content %} + + +
+
+ +
+
+

Grading papers for {{ data.user.get_full_name.title }}


-

Grading papers for {{ data.user.get_full_name.title }}

Name: {{ data.user.get_full_name.title }} @@ -30,7 +39,7 @@ Start time: {{ paper.start_time }}

{% if paper.answers.count %} -

Answers

+

Answers


{% csrf_token %} @@ -54,14 +63,15 @@ Start time: {{ paper.start_time }}
{% with answers|last as answer %} Marks: + value="{{ answer.marks }}">

{% endwith %} {% endfor %} {# for question, answers ... #}

Teacher comments:

-
- +
+
+
{% endif %} {# if paper.answers.count #} @@ -80,4 +90,15 @@ Marks: Admin +
+
+
+ + +
+ + + {% endblock content %} diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html index 9fb442a..8026a73 100644 --- a/testapp/templates/exam/user_data.html +++ b/testapp/templates/exam/user_data.html @@ -3,8 +3,18 @@ {% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %} {% block content %} + + +
+
+ +
+
+

Data for user {{ data.user.get_full_name.title }}


+
-

Data for user {{ data.user.get_full_name.title }}

Name: {{ data.user.get_full_name.title }}
@@ -81,4 +91,16 @@ User IP address: {{ paper.user_ip }}
Admin +

+
+
+ + +
+ + + + {% endblock content %} -- cgit From 573dcc6149f3ccf8ffaa2df2dba3461b3b795c48 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 2 Feb 2012 12:45:09 +0530 Subject: Updated Views.py, monitor.html and login.html with new changes --- testapp/exam/views.py | 10 ++++----- testapp/templates/exam/login.html | 11 +++++----- testapp/templates/exam/monitor.html | 43 +++++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index c178a0b..05b69d1 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -5,6 +5,7 @@ import stat from os.path import dirname, pardir, abspath, join, exists import datetime +from django.http import HttpResponse from django.contrib.auth import login, logout, authenticate from django.shortcuts import render_to_response, get_object_or_404, redirect from django.template import RequestContext @@ -246,15 +247,15 @@ def check(request, q_id): return show_question(request, next_q) def quit(request): - return my_render_to_response('exam/quit.html', - context_instance=RequestContext(request)) + + return my_render_to_response('exam/quit.html',context_instance=RequestContext(request)) -def complete(request, reason=None): +def complete(request,reason = None): user = request.user no = False message = reason or 'The quiz has been completed. Thank you.' if request.method == 'POST' and 'no' in request.POST: - no = request.POST.get('no', False) + no = True if not no: # Logout the user and quit with the message given. logout(request) @@ -263,7 +264,6 @@ def complete(request, reason=None): else: return my_redirect('/exam/') - def monitor(request, quiz_id=None): """Monitor the progress of the papers taken so far.""" user = request.user diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html index 9420903..0908fc2 100644 --- a/testapp/templates/exam/login.html +++ b/testapp/templates/exam/login.html @@ -19,19 +19,20 @@
{{ form.as_table }}
-
 
+
    

Forgot Password?

New User? Sign-Up
@@ -48,4 +49,4 @@ -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index fb6cb58..0b59f76 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -1,22 +1,35 @@ {% extends "base.html" %} + + {% block title %} Quiz results {% endblock title %} {% block meta %} {% endblock meta %} + + {% block content %} +
+
+ +
+
-

No quizzes available.

+
No quizzes available.
{% endif %} {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %} -

Available quizzes

+

Available quizzes

+
+
+
    {% for quiz in quizzes %} @@ -28,11 +41,24 @@ {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor/quiz_num #} {% if quiz %} -

    {{ quiz.description }} results

    +

    {{ quiz.description }} results

    +
+
+
+ {% if papers %} {#

Quiz: {{ quiz_name }}

#}

Number of papers: {{ papers|length }}

- + @@ -61,7 +87,12 @@

No answer papers so far.

{% endif %} {# if papers #} {% endif %} - Admin + + +
+

© FOSSEE group, IIT Bombay

+
+ {% endblock content %} -- cgit From 493f228229d96dab4a13b21cf7d4d089fcf7b2fd Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 6 Feb 2012 15:20:41 +0530 Subject: removed & tags from the forms --- testapp/templates/exam/grade_user.html | 5 +--- testapp/templates/exam/intro.html | 6 +---- testapp/templates/exam/login.html | 8 ++---- testapp/templates/exam/quit.html | 46 ++++++++++++++-------------------- testapp/templates/exam/register.html | 5 ---- testapp/templates/exam/user_data.html | 6 +---- 6 files changed, 24 insertions(+), 52 deletions(-) diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 2237475..89faf46 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -3,8 +3,7 @@ {% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %} {% block content %} - - +
Name
{{ form.as_table }}
@@ -33,7 +30,5 @@
- - {% endblock content %} diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html index 8026a73..b9cbbb5 100644 --- a/testapp/templates/exam/user_data.html +++ b/testapp/templates/exam/user_data.html @@ -3,8 +3,7 @@ {% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %} {% block content %} - - +
- - - {% endblock content %} -- cgit From f9540ba9b83ac2dc33885f3c8089f36a218d6273 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 6 Feb 2012 15:29:25 +0530 Subject: removed & tags --- testapp/templates/exam/complete.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/testapp/templates/exam/complete.html b/testapp/templates/exam/complete.html index 6790ea1..6a401a4 100644 --- a/testapp/templates/exam/complete.html +++ b/testapp/templates/exam/complete.html @@ -4,8 +4,7 @@ {% block content %} - - +
- - + {% endblock content %} -- cgit From 85a76d4777d3917cf5dbb716107581d4998c408d Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 7 Feb 2012 11:45:56 +0530 Subject: changes in question.html --- testapp/templates/exam/question.html | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html index d843981..a02e8c4 100644 --- a/testapp/templates/exam/question.html +++ b/testapp/templates/exam/question.html @@ -1,7 +1,6 @@ {% extends "base.html" %} - - + {% block title %} Answer question {% endblock %} {% block script %} @@ -46,20 +45,32 @@ function update_time() {% endblock script %} - - + {% block onload %} onload="update_time()" {% endblock onload %} {% block content %} -
+
+
+
+

Online Test

+ + + + {% csrf_token %} + + +
+
+
+
-
-
+
+

{{ question.summary }}

{{ question.description|safe }}
@@ -96,15 +107,11 @@ function update_time()

Time left:


-
-{% csrf_token %} - - -
+

© FOSSEE group, IIT Bombay

- + {% endblock content %} -- cgit From 7c65d02d8a1f2ea72eabf3f13f85b8b444b1505e Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Wed, 15 Feb 2012 18:35:40 +0530 Subject: New views to manage/moderate Quiz --- testapp/exam/urls.py | 4 ++++ testapp/exam/views.py | 17 +++++++++++++++++ testapp/static/exam/css/base.css | 4 ++-- testapp/templates/exam/grade_user.html | 24 ++++-------------------- testapp/templates/exam/monitor.html | 29 +++-------------------------- 5 files changed, 30 insertions(+), 48 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 34e329f..4545897 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -3,6 +3,10 @@ from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('exam.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), + url(r'^manage/$', 'prof_manage'), + url(r'^addquestion/$', 'add_question'), + url(r'^addquiz/$', 'add_quiz'), + url(r'^grade_user/$', 'show_all_users'), url(r'^register/$', 'user_register'), url(r'^start/$', 'start'), url(r'^quit/$', 'quit'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 05b69d1..aed45d5 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -90,6 +90,15 @@ def user_register(request): {'form':form}, context_instance=RequestContext(request)) +def add_question(request): + return render_to_response('exam/add_question.html',{}) + +def add_quiz(request): + return render_to_response('exam/add_quiz.html',{}) + +def prof_manage(request): + return render_to_response('manage.html',{}) + def user_login(request): """Take the credentials of the user and log the user in.""" @@ -309,6 +318,12 @@ def get_user_data(username): data['papers'] = papers return data +def show_all_users(request): + user = User.objects.filter(username__contains="") + context = { 'user':user } + print context + return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) + def user_data(request, username): """Render user data.""" current_user = request.user @@ -342,10 +357,12 @@ def grade_user(request, username): paper.save() context = {'data': data} + print context return my_render_to_response('exam/user_data.html', context, context_instance=RequestContext(request)) else: context = {'data': data} + print context return my_render_to_response('exam/grade_user.html', context, context_instance=RequestContext(request)) diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index ef5b374..6891402 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -207,7 +207,7 @@ body { } .container-fluid > .sidebar { position: absolute; - top: 0; + top: 65px; left: 20px; width: 220px; } @@ -2132,7 +2132,7 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { background-color: #f5f5f5; margin-bottom: 20px; padding: 19px; - min-height: 20px; + min-height: 505px; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.05); -webkit-border-radius: 4px; diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 89faf46..fa0e516 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -1,18 +1,10 @@ -{% extends "base.html" %} +{% extends "manage.html" %} {% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %} -{% block content %} - -
-
- -
-
-

Grading papers for {{ data.user.get_full_name.title }}


+{% block subtitle %}Grading papers for {{ data.user.get_full_name.title }}{% endblock %} +{% block manage %}

Name: {{ data.user.get_full_name.title }} @@ -89,13 +81,5 @@ Marks: Admin -

-
-
-
-

© FOSSEE group, IIT Bombay

-
- -
-{% endblock content %} +{% endblock%} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index 0b59f76..4847545 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -1,23 +1,13 @@ -{% extends "base.html" %} - - +{% extends "manage.html" %} {% block title %} Quiz results {% endblock title %} {% block meta %} {% endblock meta %} - -{% block content %} -
-
- -
-
No quizzes available.
@@ -27,9 +17,6 @@ {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %}

Available quizzes

-
-
-
    {% for quiz in quizzes %} @@ -42,9 +29,6 @@ {# This is rendered when we are just viewing exam/monitor/quiz_num #} {% if quiz %}

    {{ quiz.description }} results

    -
-
-
{% if papers %} {#

Quiz: {{ quiz_name }}

#} @@ -88,11 +72,4 @@ table tbody th { {% endif %} {# if papers #} {% endif %} Admin -
- - -
-

© FOSSEE group, IIT Bombay

-
-
-{% endblock content %} +{% endblock %} -- cgit From 8c548960349a01393141845d0ae1e728e9130b7c Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 16 Feb 2012 11:18:55 +0530 Subject: The new html files --- testapp/templates/exam/add_question.html | 9 +++++++ testapp/templates/exam/add_quiz.html | 10 ++++++++ testapp/templates/exam/showusers.html | 12 +++++++++ testapp/templates/manage.html | 42 ++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 testapp/templates/exam/add_question.html create mode 100644 testapp/templates/exam/add_quiz.html create mode 100644 testapp/templates/exam/showusers.html create mode 100644 testapp/templates/manage.html diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html new file mode 100644 index 0000000..fb5d38b --- /dev/null +++ b/testapp/templates/exam/add_question.html @@ -0,0 +1,9 @@ +{% extends "manage.html" %} + +{% block subtitle %} +Add Question +{% endblock %} + +{% block manage %} +

Add Question +{% endblock %} diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html new file mode 100644 index 0000000..d568b30 --- /dev/null +++ b/testapp/templates/exam/add_quiz.html @@ -0,0 +1,10 @@ +{% extends "manage.html" %} + + +{% block subtitle %} +Add Quiz +{% endblock %} + +{% block manage %} +

Add Quiz +{% endblock %} diff --git a/testapp/templates/exam/showusers.html b/testapp/templates/exam/showusers.html new file mode 100644 index 0000000..ad9534f --- /dev/null +++ b/testapp/templates/exam/showusers.html @@ -0,0 +1,12 @@ +{% extends "manage.html" %} + + +{% block subtitle %} +List of Users +{% endblock %} + +{% block manage %} +{% for name in user %} +{{ name }}
+{% endfor %} +{% endblock %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html new file mode 100644 index 0000000..3b67999 --- /dev/null +++ b/testapp/templates/manage.html @@ -0,0 +1,42 @@ +{% extends "base.html" %} + +{% block title %}Manage{% endblock title %} + +{% block content %} + +

+ +
+ +
+
+ + +
+
+

{% block subtitle %} {% endblock %}


+ {% block manage %} + {% endblock %} +
+
+
+
+

© FOSSEE group, IIT Bombay

+
+ +
+ + +{% endblock content %} -- cgit From d18df85469fc993520ee397f4a28b422c550408a Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 16 Feb 2012 12:51:32 +0530 Subject: Form to Add New Quiz --- testapp/exam/forms.py | 9 ++++++++- testapp/exam/views.py | 23 +++++++++++++++++++++-- testapp/templates/exam/add_quiz.html | 19 ++++++++++++++++++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index d99a04d..a867f5f 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -5,7 +5,7 @@ from django.contrib.auth import authenticate from django.contrib.auth.models import User from string import letters, punctuation, digits - +import datetime UNAME_CHARS = letters + "._" + digits PWD_CHARS = letters + punctuation + digits @@ -96,3 +96,10 @@ class UserLoginForm(forms.Form): return user + + +class QuizForm(forms.Form): + start_date = forms.DateField(initial=datetime.date.today) + duration = forms.IntegerField() + active = forms.BooleanField(required = False) + description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index aed45d5..22e701e 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -14,7 +14,7 @@ from django.db.models import Sum # Local imports. from exam.models import Quiz, Question, QuestionPaper, Profile, Answer, User -from exam.forms import UserRegisterForm, UserLoginForm +from exam.forms import UserRegisterForm, UserLoginForm, QuizForm from exam.xmlrpc_clients import code_server from settings import URL_ROOT @@ -94,7 +94,26 @@ def add_question(request): return render_to_response('exam/add_question.html',{}) def add_quiz(request): - return render_to_response('exam/add_quiz.html',{}) + + if request.method == "POST": + form = QuizForm(request.POST) + if form.is_valid(): + data = form.cleaned_data + u_name, pwd = form.save() + + new_user = authenticate(username = u_name, password = pwd) + login(request, new_user) + return my_redirect("/exam/manage/add_quiz") + + else: + return my_render_to_response('exam/add_quiz.html', + {'form':form}, + context_instance=RequestContext(request)) + else: + form = QuizForm() + return my_render_to_response('exam/add_quiz.html', + {'form':form}, + context_instance=RequestContext(request)) def prof_manage(request): return render_to_response('manage.html',{}) diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index d568b30..a412ecc 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -6,5 +6,22 @@ Add Quiz {% endblock %} {% block manage %} -

Add Quiz + + +

+{% csrf_token %} +
+ +{{ form.as_table }} +
+
+
+
{% endblock %} -- cgit From c20539ed5f879c945cc89323e00daad96047d247 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 16 Feb 2012 13:02:49 +0530 Subject: Form to add New Question --- testapp/exam/forms.py | 19 +++++++++++++++++-- testapp/exam/views.py | 19 +++++++++++++++++-- testapp/templates/exam/add_question.html | 21 +++++++++++++++++++-- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index a867f5f..6d431e7 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -6,6 +6,13 @@ from django.contrib.auth.models import User from string import letters, punctuation, digits import datetime + +QUESTION_TYPE_CHOICES = ( + ("python", "Python"), + ("bash", "Bash"), + ("mcq", "MultipleChoice"), + ) + UNAME_CHARS = letters + "._" + digits PWD_CHARS = letters + punctuation + digits @@ -96,10 +103,18 @@ class UserLoginForm(forms.Form): return user - - class QuizForm(forms.Form): start_date = forms.DateField(initial=datetime.date.today) duration = forms.IntegerField() active = forms.BooleanField(required = False) description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) + +class AddQuestionForm(forms.Form): + summary = forms.CharField(max_length = 128) + description = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + points = forms.FloatField() + test = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + options = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) + type = forms.CharField(max_length=24, widget=forms.Select(choices=QUESTION_TYPE_CHOICES)) + active = forms.BooleanField(required=False) + diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 22e701e..23534f5 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -14,7 +14,7 @@ from django.db.models import Sum # Local imports. from exam.models import Quiz, Question, QuestionPaper, Profile, Answer, User -from exam.forms import UserRegisterForm, UserLoginForm, QuizForm +from exam.forms import UserRegisterForm, UserLoginForm, QuizForm , AddQuestionForm from exam.xmlrpc_clients import code_server from settings import URL_ROOT @@ -91,7 +91,22 @@ def user_register(request): context_instance=RequestContext(request)) def add_question(request): - return render_to_response('exam/add_question.html',{}) + + if request.method == "POST": + form = AddQuestionForm(request.POST) + if form.is_valid(): + data = form.cleaned_data + return my_redirect("/exam/start/") + + else: + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) + else: + form = AddQuestionForm() + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) def add_quiz(request): diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index fb5d38b..a0ba14d 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -1,9 +1,26 @@ {% extends "manage.html" %} -{% block subtitle %} +{% block subtitle %} Add Question {% endblock %} + {% block manage %} -

Add Question + + +

+{% csrf_token %} +
+{{ form.as_table }} +
+
+ {% endblock %} + -- cgit From 467adb5d403e7dd29a83f44d06c80cdca8b4e7a1 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 16 Feb 2012 15:37:20 +0530 Subject: Form to add New Quiz --- testapp/exam/forms.py | 24 +++++++++++++++++++----- testapp/exam/views.py | 12 ++++-------- testapp/templates/exam/add_question.html | 1 + testapp/templates/exam/add_quiz.html | 3 ++- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index 6d431e7..a09118c 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -1,9 +1,10 @@ from django import forms -from exam.models import Profile +from exam.models import Profile,Quiz from django.contrib.auth import authenticate from django.contrib.auth.models import User + from string import letters, punctuation, digits import datetime @@ -104,10 +105,23 @@ class UserLoginForm(forms.Form): return user class QuizForm(forms.Form): - start_date = forms.DateField(initial=datetime.date.today) - duration = forms.IntegerField() - active = forms.BooleanField(required = False) - description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) + start_date = forms.DateField(initial=datetime.date.today) + duration = forms.IntegerField() + active = forms.BooleanField(required = False) + description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) + + def save(self): + start_date = self.cleaned_data["start_date"] + duration = self.cleaned_data["duration"] + active = self.cleaned_data['active'] + description = self.cleaned_data["description"] + + new_quiz = Quiz() + new_quiz.start_date=start_date + new_quiz.duration=duration + new_quiz.active=active + new_quiz.description=description + new_quiz.save(); class AddQuestionForm(forms.Form): summary = forms.CharField(max_length = 128) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 23534f5..1c5d2e5 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -109,24 +109,20 @@ def add_question(request): context_instance=RequestContext(request)) def add_quiz(request): - if request.method == "POST": form = QuizForm(request.POST) if form.is_valid(): data = form.cleaned_data - u_name, pwd = form.save() - - new_user = authenticate(username = u_name, password = pwd) - login(request, new_user) - return my_redirect("/exam/manage/add_quiz") + form.save() + return my_redirect("/exam/manage/addquiz") else: - return my_render_to_response('exam/add_quiz.html', + return my_render_to_response('exam/addquiz.html', {'form':form}, context_instance=RequestContext(request)) else: form = QuizForm() - return my_render_to_response('exam/add_quiz.html', + return my_render_to_response('exam/addquiz.html', {'form':form}, context_instance=RequestContext(request)) diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index a0ba14d..ae86ed1 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -21,6 +21,7 @@ table th, table td { {{ form.as_table }}
+
{% endblock %} diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index a412ecc..80a52ed 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -22,6 +22,7 @@ table th, table td { {{ form.as_table }}
-
+
+
{% endblock %} -- cgit From 7df150b5a12f4b96041d9fc79ec24a09a8cf5e4c Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 16 Feb 2012 15:57:39 +0530 Subject: Form to add a new question --- testapp/exam/forms.py | 23 +++++++++++++++++++++-- testapp/exam/views.py | 3 ++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index a09118c..f0c515a 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -1,5 +1,5 @@ from django import forms -from exam.models import Profile,Quiz +from exam.models import Profile,Quiz,Question from django.contrib.auth import authenticate from django.contrib.auth.models import User @@ -121,7 +121,7 @@ class QuizForm(forms.Form): new_quiz.duration=duration new_quiz.active=active new_quiz.description=description - new_quiz.save(); + new_quiz.save() class AddQuestionForm(forms.Form): summary = forms.CharField(max_length = 128) @@ -132,3 +132,22 @@ class AddQuestionForm(forms.Form): type = forms.CharField(max_length=24, widget=forms.Select(choices=QUESTION_TYPE_CHOICES)) active = forms.BooleanField(required=False) + def save(self): + summary = self.cleaned_data["summary"] + description = self.cleaned_data["description"] + points = self.cleaned_data['points'] + test = self.cleaned_data["test"] + options = self.cleaned_data['options'] + type = self.cleaned_data["type"] + active = self.cleaned_data["active"] + + new_question = Question() + new_question.summary = summary + new_question.description = description + new_question.points = points + new_question.test = test + new_question.options = options + new_question.type = type + new_question.active = active + new_question.save() + diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 1c5d2e5..0e862ca 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -96,7 +96,8 @@ def add_question(request): form = AddQuestionForm(request.POST) if form.is_valid(): data = form.cleaned_data - return my_redirect("/exam/start/") + form.save() + return my_redirect("/exam/addquestion/") else: return my_render_to_response('exam/add_question.html', -- cgit From 7dbb5b44622984b064768b84008998555f2f3b0b Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 16 Feb 2012 16:19:13 +0530 Subject: minor correction in views.py --- testapp/exam/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 0e862ca..2b4a0fe 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -118,12 +118,12 @@ def add_quiz(request): return my_redirect("/exam/manage/addquiz") else: - return my_render_to_response('exam/addquiz.html', + return my_render_to_response('exam/add_quiz.html', {'form':form}, context_instance=RequestContext(request)) else: form = QuizForm() - return my_render_to_response('exam/addquiz.html', + return my_render_to_response('exam/add_quiz.html', {'form':form}, context_instance=RequestContext(request)) -- cgit From 3cf25b2893bc7b9c7e31240a6e43aedfade68080 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Thu, 16 Feb 2012 16:29:06 +0530 Subject: minor correction on views.py --- testapp/exam/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 2b4a0fe..7c7a8ad 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -115,7 +115,7 @@ def add_quiz(request): if form.is_valid(): data = form.cleaned_data form.save() - return my_redirect("/exam/manage/addquiz") + return my_redirect("/exam/addquiz") else: return my_render_to_response('exam/add_quiz.html', -- cgit From cc348af7bed2430dbd1c748138642ea7ecbe09a9 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Fri, 17 Feb 2012 12:12:33 +0530 Subject: minor url changes --- testapp/exam/urls.py | 8 ++++---- testapp/exam/views.py | 4 ++-- testapp/templates/manage.html | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 4545897..8fa9a36 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -4,14 +4,14 @@ urlpatterns = patterns('exam.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), url(r'^manage/$', 'prof_manage'), - url(r'^addquestion/$', 'add_question'), - url(r'^addquiz/$', 'add_quiz'), - url(r'^grade_user/$', 'show_all_users'), + url(r'^manage/addquestion/$', 'add_question'), + url(r'^manage/addquiz/$', 'add_quiz'), + url(r'^manage/gradeuser/$', 'show_all_users'), url(r'^register/$', 'user_register'), url(r'^start/$', 'start'), url(r'^quit/$', 'quit'), url(r'^complete/$', 'complete'), - url(r'^monitor/$', 'monitor'), + url(r'^manage/monitor/$', 'monitor'), url(r'^monitor/(?P\d+)/$', 'monitor'), url(r'^user_data/(?P[a-zA-Z0-9_.]+)/$', 'user_data'), url(r'^grade_user/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 7c7a8ad..b202ff3 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -97,7 +97,7 @@ def add_question(request): if form.is_valid(): data = form.cleaned_data form.save() - return my_redirect("/exam/addquestion/") + return my_redirect("/exam/manage/addquestion/") else: return my_render_to_response('exam/add_question.html', @@ -115,7 +115,7 @@ def add_quiz(request): if form.is_valid(): data = form.cleaned_data form.save() - return my_redirect("/exam/addquiz") + return my_redirect("/exam/manage/addquiz") else: return my_render_to_response('exam/add_quiz.html', diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index 3b67999..58b19ef 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -9,10 +9,10 @@
-- cgit From 44ae45331c5ec81a7a7c4ed6f6d88f67f41be909 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Fri, 17 Feb 2012 12:32:40 +0530 Subject: Minor changes for Resolution settings --- testapp/templates/manage.html | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index 58b19ef..c8b0b99 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -4,20 +4,6 @@ {% block content %} -
- -
-
-
+

{% block subtitle %} {% endblock %}


{% block manage %} {% endblock %}
+ + +
+
Manage
+ +
-- cgit From 24e5101972e846ac800932a4721f7e93bf5bdb1b Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Fri, 17 Feb 2012 12:53:34 +0530 Subject: minor changes for URLs --- testapp/exam/urls.py | 4 ++-- testapp/templates/manage.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 8fa9a36..72c93fa 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -12,9 +12,9 @@ urlpatterns = patterns('exam.views', url(r'^quit/$', 'quit'), url(r'^complete/$', 'complete'), url(r'^manage/monitor/$', 'monitor'), - url(r'^monitor/(?P\d+)/$', 'monitor'), + url(r'^manage/monitor/(?P\d+)/$', 'monitor'), url(r'^user_data/(?P[a-zA-Z0-9_.]+)/$', 'user_data'), - url(r'^grade_user/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), + url(r'^manage/grade_user/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), url(r'^(?P\d+)/$', 'question'), url(r'^(?P\d+)/check/$', 'check'), ) diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index c8b0b99..c757523 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -25,10 +25,10 @@
-- cgit From e8ba4ba5301a805194a555f52275407f045b91ab Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 20 Feb 2012 19:51:32 +0530 Subject: New file to manage questions --- testapp/templates/exam/showquestions.html | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 testapp/templates/exam/showquestions.html diff --git a/testapp/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html new file mode 100644 index 0000000..38d4bcc --- /dev/null +++ b/testapp/templates/exam/showquestions.html @@ -0,0 +1,35 @@ +{% extends "manage.html" %} + + +{% block subtitle %} +List of Questions +{% endblock %} + +{% block script %} + +{% endblock %} + +{% block manage %} +
+{% csrf_token %} +{% for i in questions %} +  {{ i }}
+{% endfor %} +
+   + +
+{% endblock %} -- cgit From f6a90c1eb603c9f3b8178102e387025880c0a5ac Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 20 Feb 2012 19:51:58 +0530 Subject: changes to manage questions --- testapp/exam/urls.py | 1 + testapp/exam/views.py | 62 +++++++++++++++++++++++--------- testapp/templates/exam/add_question.html | 2 +- testapp/templates/exam/grade_user.html | 6 ++-- testapp/templates/exam/monitor.html | 2 +- testapp/templates/exam/showusers.html | 3 +- testapp/templates/exam/user_data.html | 8 ++--- testapp/templates/manage.html | 4 +-- 8 files changed, 59 insertions(+), 29 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 72c93fa..504a4e6 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -7,6 +7,7 @@ urlpatterns = patterns('exam.views', url(r'^manage/addquestion/$', 'add_question'), url(r'^manage/addquiz/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), + url(r'^manage/questions/$', 'show_all_questions'), url(r'^register/$', 'user_register'), url(r'^start/$', 'start'), url(r'^quit/$', 'quit'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index b202ff3..b8233b2 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -91,23 +91,23 @@ def user_register(request): context_instance=RequestContext(request)) def add_question(request): - - if request.method == "POST": - form = AddQuestionForm(request.POST) - if form.is_valid(): - data = form.cleaned_data - form.save() - return my_redirect("/exam/manage/addquestion/") - - else: - return my_render_to_response('exam/add_question.html', - {'form':form}, - context_instance=RequestContext(request)) - else: - form = AddQuestionForm() - return my_render_to_response('exam/add_question.html', - {'form':form}, - context_instance=RequestContext(request)) + + if request.method == "POST": + form = AddQuestionForm(request.POST) + if form.is_valid(): + data = form.cleaned_data + form.save() + return my_redirect("/exam/manage/questions/") + + else: + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) + else: + form = AddQuestionForm() + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) def add_quiz(request): if request.method == "POST": @@ -355,6 +355,34 @@ def show_all_users(request): print context return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) +def show_all_questions(request): + if request.method == 'POST': + data = request.POST.getlist('question') + if data == None: + questions = Question.objects.all() + context = {'papers': [], + 'question': None, + 'questions':questions} + return my_render_to_response('exam/showquestions.html', context, + context_instance=RequestContext(request)) + for i in data: + question = Question.objects.get(id=i).delete() + questions = Question.objects.all() + context = {'papers': [], + 'question': None, + 'questions':questions} + return my_render_to_response('exam/showquestions.html', context, + context_instance=RequestContext(request)) + + else: + """Show the list of available quiz""" + questions = Question.objects.all() + context = {'papers': [], + 'question': None, + 'questions':questions} + return my_render_to_response('exam/showquestions.html', context, + context_instance=RequestContext(request)) + def user_data(request, username): """Render user data.""" current_user = request.user diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index ae86ed1..2d42b34 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -21,7 +21,7 @@ table th, table td { {{ form.as_table }}
-
+ {% endblock %} diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index fa0e516..bad1765 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -32,7 +32,7 @@ Start time: {{ paper.start_time }}
{% if paper.answers.count %}

Answers


+ action="{{URL_ROOT}}/exam/manage/grade_user/{{data.user.username}}/" method="post"> {% csrf_token %} {% for question, answers in paper.get_question_answers.items %}

@@ -71,11 +71,11 @@ Marks: 1 %} - + Monitor quiz {% else %} {% with data.papers.0 as paper %} - + Monitor quiz {% endwith %} {% endif %} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index 4847545..a802de2 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -20,7 +20,7 @@

{% endif %} diff --git a/testapp/templates/exam/showusers.html b/testapp/templates/exam/showusers.html index ad9534f..038cb8b 100644 --- a/testapp/templates/exam/showusers.html +++ b/testapp/templates/exam/showusers.html @@ -5,8 +5,9 @@ List of Users {% endblock %} + {% block manage %} {% for name in user %} -{{ name }}
+{{ name }}
{% endfor %} {% endblock %} diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html index b9cbbb5..c835f61 100644 --- a/testapp/templates/exam/user_data.html +++ b/testapp/templates/exam/user_data.html @@ -30,7 +30,7 @@ Last login: {{ data.user.last_login }}

{% if data.papers %} -

+

Grade/correct paper

@@ -75,15 +75,15 @@ User IP address: {{ paper.user_ip }} {% endif %} {# if data.papers #}

- + Grade/correct paper
{% if data.papers.count > 1 %} - + Monitor quiz {% else %} {% with data.papers.0 as paper %} - + Monitor quiz {% endwith %} {% endif %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index c757523..a21e8c4 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -25,8 +25,8 @@
Manage
-- cgit From c61396a219efb3b078094d028e41fe51bc857fe3 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 20 Feb 2012 20:28:51 +0530 Subject: new file to manage quiz --- testapp/templates/exam/show_quiz.html | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 testapp/templates/exam/show_quiz.html diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html new file mode 100644 index 0000000..a113953 --- /dev/null +++ b/testapp/templates/exam/show_quiz.html @@ -0,0 +1,46 @@ +{% extends "manage.html" %} + +{% block title %} Quiz List {% endblock title %} + +{% block script %} + +{% endblock %} + +{% block manage %} +{% if not quizzes and not quiz %} +

Available Quiz

+ +
No quizzes available.
+ +{% endif %} + +{# ############################################################### #} +{# This is rendered when we are just viewing exam/monitor #} +{% if quizzes %} +

List of Quizzes

+ +{% csrf_token %} +{% for quiz in quizzes %} + +  {{ quiz.description }}
+{% endfor %} +

+   + +{% endif %} +{% endblock %} -- cgit From ddb7f4e07771f4e4ca514c253d671698e1b74020 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Mon, 20 Feb 2012 20:29:06 +0530 Subject: changes to manage quiz --- testapp/exam/urls.py | 2 ++ testapp/exam/views.py | 31 ++++++++++++++++++++++++++++++- testapp/templates/exam/add_quiz.html | 2 +- testapp/templates/manage.html | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 504a4e6..772a2f3 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -8,6 +8,7 @@ urlpatterns = patterns('exam.views', url(r'^manage/addquiz/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), url(r'^manage/questions/$', 'show_all_questions'), + url(r'^manage/showquiz/$','show_all_quiz'), url(r'^register/$', 'user_register'), url(r'^start/$', 'start'), url(r'^quit/$', 'quit'), @@ -19,3 +20,4 @@ urlpatterns = patterns('exam.views', url(r'^(?P\d+)/$', 'question'), url(r'^(?P\d+)/check/$', 'check'), ) + diff --git a/testapp/exam/views.py b/testapp/exam/views.py index b8233b2..6dd5fb4 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -115,7 +115,7 @@ def add_quiz(request): if form.is_valid(): data = form.cleaned_data form.save() - return my_redirect("/exam/manage/addquiz") + return my_redirect("/exam/manage/showquiz") else: return my_render_to_response('exam/add_quiz.html', @@ -355,6 +355,35 @@ def show_all_users(request): print context return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) +def show_all_quiz(request): + if request.method == 'POST': + data = request.POST.getlist('quiz') + if data == None: + quizzes = Quiz.objects.all() + context = {'papers': [], + 'quiz': None, + 'quizzes':quizzes} + return my_render_to_response('exam/show_quiz.html', context, + context_instance=RequestContext(request)) + for i in data: + quiz = Quiz.objects.get(id=i).delete() + quizzes = Quiz.objects.all() + context = {'papers': [], + 'quiz': None, + 'quizzes':quizzes} + return my_render_to_response('exam/show_quiz.html', context, + context_instance=RequestContext(request)) + + else: + """Show the list of available quiz""" + quizzes = Quiz.objects.all() + context = {'papers': [], + 'quiz': None, + 'quizzes':quizzes} + return my_render_to_response('exam/show_quiz.html', context, + context_instance=RequestContext(request)) + + def show_all_questions(request): if request.method == 'POST': data = request.POST.getlist('question') diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index 80a52ed..d51d129 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -23,6 +23,6 @@ table th, table td {
-
+ {% endblock %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index a21e8c4..0cc47ae 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -26,7 +26,7 @@
Manage
-- cgit From 6b608e174fbd9367c9453f7933b69a35516811d2 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 21 Feb 2012 11:35:56 +0530 Subject: add docstrings to each view in views.py --- testapp/exam/views.py | 28 ++++++++++++++++++++++++---- testapp/templates/exam/show_quiz.html | 6 ++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 6dd5fb4..80632d8 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -91,7 +91,8 @@ def user_register(request): context_instance=RequestContext(request)) def add_question(request): - + """To add a new question in the database. Create a new question and store it.""" + if request.method == "POST": form = AddQuestionForm(request.POST) if form.is_valid(): @@ -110,6 +111,8 @@ def add_question(request): context_instance=RequestContext(request)) def add_quiz(request): + """To add a new quiz. Create a new quiz and store it in the database.""" + if request.method == "POST": form = QuizForm(request.POST) if form.is_valid(): @@ -128,6 +131,8 @@ def add_quiz(request): context_instance=RequestContext(request)) def prof_manage(request): + """Take credentials of the user with professor/moderator rights/permissions and log in.""" + return render_to_response('manage.html',{}) def user_login(request): @@ -154,6 +159,8 @@ def user_login(request): context_instance=RequestContext(request)) def start(request): + """Check the user cedentials and if any quiz is available, start the exam.""" + user = request.user try: # Right now the app is designed so there is only one active quiz @@ -196,6 +203,8 @@ def start(request): context_instance=ci) def question(request, q_id): + """Check the credentials of the user and start the exam.""" + user = request.user if not user.is_authenticated(): return my_redirect('/exam/login/') @@ -227,6 +236,8 @@ def show_question(request, q_id): return question(request, q_id) def check(request, q_id): + + user = request.user if not user.is_authenticated(): return my_redirect('/exam/login/') @@ -287,10 +298,13 @@ def check(request, q_id): return show_question(request, next_q) def quit(request): - + """Show the quit page when the user logs out.""" + return my_render_to_response('exam/quit.html',context_instance=RequestContext(request)) def complete(request,reason = None): + """Show a page to inform user that the quiz has been compeleted.""" + user = request.user no = False message = reason or 'The quiz has been completed. Thank you.' @@ -305,6 +319,7 @@ def complete(request,reason = None): return my_redirect('/exam/') def monitor(request, quiz_id=None): + """Monitor the progress of the papers taken so far.""" user = request.user if not user.is_authenticated() and not user.is_staff: @@ -350,12 +365,16 @@ def get_user_data(username): return data def show_all_users(request): + """Shows all the users who have taken various exams/quiz.""" + user = User.objects.filter(username__contains="") context = { 'user':user } print context return my_render_to_response('exam/showusers.html',context,context_instance=RequestContext(request)) def show_all_quiz(request): + """Generates a list of all the quizzes that are currently in the database.""" + if request.method == 'POST': data = request.POST.getlist('quiz') if data == None: @@ -375,7 +394,6 @@ def show_all_quiz(request): context_instance=RequestContext(request)) else: - """Show the list of available quiz""" quizzes = Quiz.objects.all() context = {'papers': [], 'quiz': None, @@ -385,6 +403,8 @@ def show_all_quiz(request): def show_all_questions(request): + """Show a list of all the questions currently in the databse.""" + if request.method == 'POST': data = request.POST.getlist('question') if data == None: @@ -404,7 +424,7 @@ def show_all_questions(request): context_instance=RequestContext(request)) else: - """Show the list of available quiz""" + questions = Question.objects.all() context = {'papers': [], 'question': None, diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html index a113953..bbea77f 100644 --- a/testapp/templates/exam/show_quiz.html +++ b/testapp/templates/exam/show_quiz.html @@ -23,16 +23,14 @@ function my_confirm(frm) {% block manage %} {% if not quizzes and not quiz %} -

Available Quiz

- +
Available Quiz
No quizzes available.
- {% endif %} {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %} -

List of Quizzes

+

Quiz List

{% csrf_token %} {% for quiz in quizzes %} -- cgit From 2b6b595ca8652696ab9059add8ea54661cab5f31 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 21 Feb 2012 12:38:38 +0530 Subject: views for editing quiz and questions --- testapp/exam/forms.py | 2 +- testapp/exam/urls.py | 2 + testapp/exam/views.py | 106 ++++++++++++++++++++++-------- testapp/templates/exam/show_quiz.html | 2 +- testapp/templates/exam/showquestions.html | 2 +- 5 files changed, 83 insertions(+), 31 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index f0c515a..1788a08 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -123,7 +123,7 @@ class QuizForm(forms.Form): new_quiz.description=description new_quiz.save() -class AddQuestionForm(forms.Form): +class QuestionForm(forms.Form): summary = forms.CharField(max_length = 128) description = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) points = forms.FloatField() diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 772a2f3..2187e58 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -5,7 +5,9 @@ urlpatterns = patterns('exam.views', url(r'^login/$', 'user_login'), url(r'^manage/$', 'prof_manage'), url(r'^manage/addquestion/$', 'add_question'), + url(r'^manage/addquestion/(?P\d+)/$', 'add_question'), url(r'^manage/addquiz/$', 'add_quiz'), + url(r'^manage/addquiz/(?P\d+)/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), url(r'^manage/questions/$', 'show_all_questions'), url(r'^manage/showquiz/$','show_all_quiz'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 80632d8..c2296f3 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -14,7 +14,7 @@ from django.db.models import Sum # Local imports. from exam.models import Quiz, Question, QuestionPaper, Profile, Answer, User -from exam.forms import UserRegisterForm, UserLoginForm, QuizForm , AddQuestionForm +from exam.forms import UserRegisterForm, UserLoginForm, QuizForm , QuestionForm from exam.xmlrpc_clients import code_server from settings import URL_ROOT @@ -90,45 +90,95 @@ def user_register(request): {'form':form}, context_instance=RequestContext(request)) -def add_question(request): - """To add a new question in the database. Create a new question and store it.""" - - if request.method == "POST": - form = AddQuestionForm(request.POST) - if form.is_valid(): - data = form.cleaned_data - form.save() - return my_redirect("/exam/manage/questions/") - - else: - return my_render_to_response('exam/add_question.html', - {'form':form}, - context_instance=RequestContext(request)) - else: - form = AddQuestionForm() - return my_render_to_response('exam/add_question.html', - {'form':form}, - context_instance=RequestContext(request)) - -def add_quiz(request): - """To add a new quiz. Create a new quiz and store it in the database.""" +def add_question(request,question_id=None): + """To add a new question in the database. Create a new question and store it.""" if request.method == "POST": - form = QuizForm(request.POST) + form = QuestionForm(request.POST) if form.is_valid(): data = form.cleaned_data - form.save() - return my_redirect("/exam/manage/showquiz") + if question_id == None: + form.save() + return my_redirect("/exam/manage/questions") + else: + d = Question.objects.get(id=question_id) + d.summary = form['summary'].data + d.description = form['description'].data + d.points = form['points'].data + d.test = form['test'].data + d.options = form['options'].data + d.type = form['type'].data + d.active = form['active'].data + d.save() + return my_redirect("/exam/manage/questions") + + else: + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) + else: + if question_id == None: + form = QuestionForm() + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) + else: + + d = Question.objects.get(id=question_id) + form = QuestionForm() + form.initial['summary']= d.summary + form.initial['description'] = d.description + form.initial['points']= d.points + form.initial['test'] = d.test + form.initial['options'] = d.options + form.initial['type'] = d.type + form.initial['active'] = d.active + + return my_render_to_response('exam/add_question.html', + {'form':form}, + context_instance=RequestContext(request)) + + +def add_quiz(request,quiz_id=None): + if request.method == "POST": + form = QuizForm(request.POST) + if form.is_valid(): + data = form.cleaned_data + if quiz_id == None: + form.save() + return my_redirect("/exam/manage/showquiz") + else: + d = Quiz.objects.get(id=quiz_id) + d.start_date = form['start_date'].data + d.duration = form['duration'].data + d.active = form['active'].data + d.description = form['description'].data + d.save() + return my_redirect("/exam/manage/showquiz") else: return my_render_to_response('exam/add_quiz.html', {'form':form}, context_instance=RequestContext(request)) else: - form = QuizForm() - return my_render_to_response('exam/add_quiz.html', + if quiz_id == None: + form = QuizForm() + return my_render_to_response('exam/add_quiz.html', {'form':form}, context_instance=RequestContext(request)) + else: + + d = Quiz.objects.get(id=quiz_id) + form = QuizForm() + form.initial['start_date']= d.start_date + form.initial['duration'] = d.duration + form.initial['description']= d.description + form.initial['active'] = d.active + + return my_render_to_response('exam/add_quiz.html', + {'form':form}, + context_instance=RequestContext(request)) + def prof_manage(request): """Take credentials of the user with professor/moderator rights/permissions and log in.""" diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html index bbea77f..2e9059d 100644 --- a/testapp/templates/exam/show_quiz.html +++ b/testapp/templates/exam/show_quiz.html @@ -35,7 +35,7 @@ function my_confirm(frm) {% csrf_token %} {% for quiz in quizzes %} -  {{ quiz.description }}
+  {{ quiz.description }}
{% endfor %}

   diff --git a/testapp/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html index 38d4bcc..994ca26 100644 --- a/testapp/templates/exam/showquestions.html +++ b/testapp/templates/exam/showquestions.html @@ -26,7 +26,7 @@ function my_confirm(frm) {% csrf_token %} {% for i in questions %} -  {{ i }}
+  {{ i }}
{% endfor %}
   -- cgit From f2d65592affd34bc60cf4a3a2c72de1d84c934c0 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Wed, 22 Feb 2012 16:02:07 +0530 Subject: Changes related to Authentication of Moderator --- testapp/exam/urls.py | 21 +++++----- testapp/exam/views.py | 76 ++++++++++++++++++++++------------- testapp/templates/exam/monitor.html | 4 +- testapp/templates/exam/show_quiz.html | 1 + testapp/templates/exam/showusers.html | 2 +- testapp/templates/manage.html | 4 +- 6 files changed, 68 insertions(+), 40 deletions(-) diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 2187e58..d4ebe50 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -3,23 +3,26 @@ from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('exam.views', url(r'^$', 'index'), url(r'^login/$', 'user_login'), + url(r'^start/$', 'start'), + url(r'^quit/$', 'quit'), + url(r'^complete/$', 'complete'), + url(r'^register/$', 'user_register'), + url(r'^(?P\d+)/$', 'question'), + url(r'^(?P\d+)/check/$', 'check'), + url(r'^manage/$', 'prof_manage'), url(r'^manage/addquestion/$', 'add_question'), url(r'^manage/addquestion/(?P\d+)/$', 'add_question'), url(r'^manage/addquiz/$', 'add_quiz'), url(r'^manage/addquiz/(?P\d+)/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), + url(r'^manage/gradeuser/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), url(r'^manage/questions/$', 'show_all_questions'), - url(r'^manage/showquiz/$','show_all_quiz'), - url(r'^register/$', 'user_register'), - url(r'^start/$', 'start'), - url(r'^quit/$', 'quit'), - url(r'^complete/$', 'complete'), + url(r'^manage/showquiz/$','show_all_quiz'), url(r'^manage/monitor/$', 'monitor'), url(r'^manage/monitor/(?P\d+)/$', 'monitor'), - url(r'^user_data/(?P[a-zA-Z0-9_.]+)/$', 'user_data'), - url(r'^manage/grade_user/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), - url(r'^(?P\d+)/$', 'question'), - url(r'^(?P\d+)/check/$', 'check'), + url(r'^manage/user_data/(?P[a-zA-Z0-9_.]+)/$', 'user_data'), + + ) diff --git a/testapp/exam/views.py b/testapp/exam/views.py index c2296f3..bc2290b 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -58,6 +58,8 @@ def index(request): """ user = request.user if user.is_authenticated(): + if user.groups.filter(name='moderator').count() > 0: + return my_redirect('/exam/manage/') return my_redirect("/exam/start/") return my_redirect("/exam/login/") @@ -92,7 +94,9 @@ def user_register(request): def add_question(request,question_id=None): """To add a new question in the database. Create a new question and store it.""" - + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : + raise Http404('You are not allowed to view this page!') if request.method == "POST": form = QuestionForm(request.POST) if form.is_valid(): @@ -140,6 +144,9 @@ def add_question(request,question_id=None): def add_quiz(request,quiz_id=None): + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : + raise Http404('You are not allowed to view this page!') if request.method == "POST": form = QuizForm(request.POST) if form.is_valid(): @@ -182,14 +189,18 @@ def add_quiz(request,quiz_id=None): def prof_manage(request): """Take credentials of the user with professor/moderator rights/permissions and log in.""" - - return render_to_response('manage.html',{}) + user = request.user + if user.is_authenticated() and user.groups.filter(name='moderator').count() > 0: + return render_to_response('manage.html',{}) + return my_redirect('/exam/login/') def user_login(request): """Take the credentials of the user and log the user in.""" user = request.user if user.is_authenticated(): + if user.groups.filter(name='moderator').count() > 0 : + return my_redirect('/exam/manage/') return my_redirect("/exam/start/") if request.method == "POST": @@ -197,7 +208,9 @@ def user_login(request): if form.is_valid(): user = form.cleaned_data login(request, user) - return my_redirect("/exam/start/") + if user.groups.filter(name='moderator').count() > 0 : + return my_redirect('/exam/manage/') + return my_redirect('/exam/start/') else: context = {"form": form} return my_render_to_response('exam/login.html', context, @@ -358,6 +371,8 @@ def complete(request,reason = None): user = request.user no = False message = reason or 'The quiz has been completed. Thank you.' + if user.groups.filter(name='moderator').count() > 0: + message = 'You are successfully Logged out. Thanks for spending some time with the application' if request.method == 'POST' and 'no' in request.POST: no = True if not no: @@ -372,7 +387,7 @@ def monitor(request, quiz_id=None): """Monitor the progress of the papers taken so far.""" user = request.user - if not user.is_authenticated() and not user.is_staff: + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page!') if quiz_id is None: @@ -416,7 +431,9 @@ def get_user_data(username): def show_all_users(request): """Shows all the users who have taken various exams/quiz.""" - + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: + raise Http404('You are not allowed to view this page !') user = User.objects.filter(username__contains="") context = { 'user':user } print context @@ -424,6 +441,9 @@ def show_all_users(request): def show_all_quiz(request): """Generates a list of all the quizzes that are currently in the database.""" + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: + raise Http404('You are not allowed to view this page !') if request.method == 'POST': data = request.POST.getlist('quiz') @@ -453,39 +473,41 @@ def show_all_quiz(request): def show_all_questions(request): - """Show a list of all the questions currently in the databse.""" + """Show a list of all the questions currently in the databse.""" + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : + raise Http404("You are not allowed to view this page !") - if request.method == 'POST': - data = request.POST.getlist('question') - if data == None: - questions = Question.objects.all() - context = {'papers': [], - 'question': None, - 'questions':questions} - return my_render_to_response('exam/showquestions.html', context, + if request.method == 'POST': + data = request.POST.getlist('question') + if data == None: + questions = Question.objects.all() + context = {'papers': [], + 'question': None, + 'questions':questions} + return my_render_to_response('exam/showquestions.html', context, context_instance=RequestContext(request)) - for i in data: - question = Question.objects.get(id=i).delete() - questions = Question.objects.all() - context = {'papers': [], + for i in data: + question = Question.objects.get(id=i).delete() + questions = Question.objects.all() + context = {'papers': [], 'question': None, 'questions':questions} - return my_render_to_response('exam/showquestions.html', context, + return my_render_to_response('exam/showquestions.html', context, context_instance=RequestContext(request)) - else: - - questions = Question.objects.all() - context = {'papers': [], + else: + questions = Question.objects.all() + context = {'papers': [], 'question': None, 'questions':questions} - return my_render_to_response('exam/showquestions.html', context, + return my_render_to_response('exam/showquestions.html', context, context_instance=RequestContext(request)) def user_data(request, username): """Render user data.""" current_user = request.user - if not current_user.is_authenticated() and not current_user.is_staff: + if not current_user.is_authenticated() or current_user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page!') data = get_user_data(username) @@ -499,7 +521,7 @@ def grade_user(request, username): and update all their marks and also give comments for each paper. """ current_user = request.user - if not current_user.is_authenticated() and not current_user.is_staff: + if not current_user.is_authenticated() or current_user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page!') data = get_user_data(username) diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index a802de2..60814c7 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -55,9 +55,9 @@ table tbody th { {% for paper in papers %} - + {{ paper.user.get_full_name.title }} - + {{ paper.user.username }} {{ paper.profile.roll_number }} {{ paper.profile.institute }} diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html index 2e9059d..001b2fe 100644 --- a/testapp/templates/exam/show_quiz.html +++ b/testapp/templates/exam/show_quiz.html @@ -33,6 +33,7 @@ function my_confirm(frm)

Quiz List

{% csrf_token %} + {% for quiz in quizzes %}   {{ quiz.description }}
diff --git a/testapp/templates/exam/showusers.html b/testapp/templates/exam/showusers.html index 038cb8b..441b921 100644 --- a/testapp/templates/exam/showusers.html +++ b/testapp/templates/exam/showusers.html @@ -8,6 +8,6 @@ List of Users {% block manage %} {% for name in user %} -{{ name }}
+{{ name }}
{% endfor %} {% endblock %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index 0cc47ae..c7c6fa1 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -7,7 +7,9 @@
-- cgit From 9acff5f2cf9f9ae3d2fc097e1fcd84712d3199d0 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 23 Feb 2012 16:30:36 +0530 Subject: more changes to edit multiple questions at a time --- testapp/exam/urls.py | 1 + testapp/exam/views.py | 59 +++++++++++++++++++++++++++++-- testapp/static/exam/css/base.css | 2 +- testapp/templates/exam/edit_question.html | 29 +++++++++++++++ testapp/templates/exam/showquestions.html | 18 ++++++++-- testapp/templates/manage.html | 6 +++- 6 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 testapp/templates/exam/edit_question.html diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index d4ebe50..67debd2 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -14,6 +14,7 @@ urlpatterns = patterns('exam.views', url(r'^manage/addquestion/$', 'add_question'), url(r'^manage/addquestion/(?P\d+)/$', 'add_question'), url(r'^manage/addquiz/$', 'add_quiz'), + url(r'^manage/editquestion/$', 'edit_question'), url(r'^manage/addquiz/(?P\d+)/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), url(r'^manage/gradeuser/(?P[a-zA-Z0-9_.]+)/$', 'grade_user'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index bc2290b..22151e7 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -92,6 +92,33 @@ def user_register(request): {'form':form}, context_instance=RequestContext(request)) +def edit_question(request): + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : + raise Http404('You are not allowed to view this page!') + + summary = request.POST.getlist('summary') + description = request.POST.getlist('description') + points = request.POST.getlist('points') + test = request.POST.getlist('test') + options = request.POST.getlist('options') + type = request.POST.getlist('type') + active = request.POST.getlist('active') + j = 0 + for i in editquestionlist: + question = Question.objects.get(id=i) + question.summary = summary[j] + question.description = description[j] + question.points = points[j] + question.test = test[j] + question.options = options[j] + question.type = type[j] + question.active = active[j] + question.save() + j += 1 + return my_redirect("/exam/manage/questions") + + def add_question(request,question_id=None): """To add a new question in the database. Create a new question and store it.""" user = request.user @@ -478,7 +505,7 @@ def show_all_questions(request): if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404("You are not allowed to view this page !") - if request.method == 'POST': + if request.method == 'POST' and request.POST.get('delete')=='delete': data = request.POST.getlist('question') if data == None: questions = Question.objects.all() @@ -495,7 +522,35 @@ def show_all_questions(request): 'questions':questions} return my_render_to_response('exam/showquestions.html', context, context_instance=RequestContext(request)) - + + elif request.method == 'POST' and request.POST.get('edit')=='edit': + data = request.POST.getlist('question') + global editquestionlist + editquestionlist = data + if data == None: + questions = Question.objects.all() + context = {'papers': [], + 'question': None, + 'questions':questions} + return my_render_to_response('exam/showquestions.html', context, + context_instance=RequestContext(request)) + + forms = [] + for j in data: + d = Question.objects.get(id=j) + form = QuestionForm() + form.initial['summary']= d.summary + form.initial['description'] = d.description + form.initial['points']= d.points + form.initial['test'] = d.test + form.initial['options'] = d.options + form.initial['type'] = d.type + form.initial['active'] = d.active + forms.append(form) + + return my_render_to_response('exam/edit_question.html', + {'forms':forms}, + context_instance=RequestContext(request)) else: questions = Question.objects.all() context = {'papers': [], diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index 6891402..9a37d2f 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -482,7 +482,7 @@ dl dd { hr { margin: 20px 0 19px; border: 0; - border-bottom: 1px solid #eee; + border-bottom: 10px solid; } strong { font-style: inherit; diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html new file mode 100644 index 0000000..04217ab --- /dev/null +++ b/testapp/templates/exam/edit_question.html @@ -0,0 +1,29 @@ +{% extends "manage.html" %} + +{% block subtitle %} +Edit Question +{% endblock %} + + +{% block manage %} + + + +{% csrf_token %} +{% for form in forms %} + +{{ form.as_table }} +
+
+{% endfor %} +
+
+ +{% endblock %} diff --git a/testapp/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html index 994ca26..edcba6f 100644 --- a/testapp/templates/exam/showquestions.html +++ b/testapp/templates/exam/showquestions.html @@ -7,7 +7,7 @@ List of Questions {% block script %} {% endblock %} @@ -30,6 +42,8 @@ function my_confirm(frm) {% endfor %}
   - +   + + {% endblock %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index c7c6fa1..10842c3 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -13,7 +13,7 @@
-
+

{% block subtitle %} {% endblock %}


{% block manage %} {% endblock %} @@ -22,6 +22,10 @@ .content .span4 { min-height: 500px; } + .textarea + { + width: 10px; + }
-- cgit From dd3fd7b8c58d836baba24441e7d55c6d51858eab Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Thu, 23 Feb 2012 18:49:36 +0530 Subject: View for Editing Quiz --- testapp/exam/urls.py | 1 + testapp/exam/views.py | 49 ++++++++++++++++++++++++++++++++++- testapp/templates/exam/edit_quiz.html | 31 ++++++++++++++++++++++ testapp/templates/exam/show_quiz.html | 15 ++++++++++- testapp/templates/exam/user_data.html | 28 +++----------------- 5 files changed, 98 insertions(+), 26 deletions(-) create mode 100644 testapp/templates/exam/edit_quiz.html diff --git a/testapp/exam/urls.py b/testapp/exam/urls.py index 67debd2..a8b81f7 100644 --- a/testapp/exam/urls.py +++ b/testapp/exam/urls.py @@ -14,6 +14,7 @@ urlpatterns = patterns('exam.views', url(r'^manage/addquestion/$', 'add_question'), url(r'^manage/addquestion/(?P\d+)/$', 'add_question'), url(r'^manage/addquiz/$', 'add_quiz'), + url(r'^manage/editquiz/$', 'edit_quiz'), url(r'^manage/editquestion/$', 'edit_question'), url(r'^manage/addquiz/(?P\d+)/$', 'add_quiz'), url(r'^manage/gradeuser/$', 'show_all_users'), diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 22151e7..6eea338 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -92,6 +92,27 @@ def user_register(request): {'form':form}, context_instance=RequestContext(request)) +def edit_quiz(request): + user = request.user + if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : + raise Http404('You are not allowed to view this page!') + + start_date = request.POST.getlist('start_date') + duration = request.POST.getlist('duration') + active = request.POST.getlist('active') + description = request.POST.getlist('description') + + j = 0 + for i in quizlist: + quiz = Quiz.objects.get(id=i) + quiz.start_date = start_date[j] + quiz.duration = duration[j] + quiz.active = active[j] + quiz.description = description[j] + quiz.save() + j += 1 + return my_redirect("/exam/manage/showquiz/") + def edit_question(request): user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : @@ -472,7 +493,7 @@ def show_all_quiz(request): if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page !') - if request.method == 'POST': + if request.method == 'POST' and request.POST.get('delete')=='delete': data = request.POST.getlist('quiz') if data == None: quizzes = Quiz.objects.all() @@ -489,6 +510,32 @@ def show_all_quiz(request): 'quizzes':quizzes} return my_render_to_response('exam/show_quiz.html', context, context_instance=RequestContext(request)) + + elif request.method == 'POST' and request.POST.get('edit')=='edit': + data = request.POST.getlist('quiz') + global quizlist + quizlist = data + if data == None: + quiz = Quiz.objects.all() + context = {'papers': [], + 'quiz': None, + 'quizzes':quiz} + return my_render_to_response('exam/showquiz.html', context, + context_instance=RequestContext(request)) + + forms = [] + for j in data: + d = Quiz.objects.get(id=j) + form = QuizForm() + form.initial['start_date']= d.start_date + form.initial['duration'] = d.duration + form.initial['active']= d.active + form.initial['description'] = d.description + forms.append(form) + + return my_render_to_response('exam/edit_quiz.html', + {'forms':forms}, + context_instance=RequestContext(request)) else: quizzes = Quiz.objects.all() diff --git a/testapp/templates/exam/edit_quiz.html b/testapp/templates/exam/edit_quiz.html new file mode 100644 index 0000000..7744623 --- /dev/null +++ b/testapp/templates/exam/edit_quiz.html @@ -0,0 +1,31 @@ +{% extends "manage.html" %} + + +{% block subtitle %} +Edit Quiz(zes) +{% endblock %} + +{% block manage %} + + +
+{% csrf_token %} +{% for form in forms %} +
+ +{{ form.as_table }} +
+
+
+{% endfor %} +
+
+
+{% endblock %} diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html index 001b2fe..d546b06 100644 --- a/testapp/templates/exam/show_quiz.html +++ b/testapp/templates/exam/show_quiz.html @@ -17,6 +17,17 @@ function my_confirm(frm) } } +function confirm_edit(frm) +{ + var n = 0; + for (var i =0;i {% endblock %} @@ -39,7 +50,9 @@ function my_confirm(frm)   {{ quiz.description }}
{% endfor %}

-   +   +   + {% endif %} {% endblock %} diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html index c835f61..943dfe8 100644 --- a/testapp/templates/exam/user_data.html +++ b/testapp/templates/exam/user_data.html @@ -1,20 +1,11 @@ -{% extends "base.html" %} +{% extends "manage.html" %} {% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %} -{% block content %} +{% block manage %} -
-
- -
-
-

Data for user {{ data.user.get_full_name.title }}


+{% block subtitle %}Data for user {{ data.user.get_full_name.title }}{% endblock %}
- -

Name: {{ data.user.get_full_name.title }}
Username: {{ data.user.username }}
@@ -87,16 +78,5 @@ User IP address: {{ paper.user_ip }} Monitor quiz {% endwith %} {% endif %} -
-Admin - -

-
-
-
-

© FOSSEE group, IIT Bombay

-
- -
-{% endblock content %} +{% endblock %} -- cgit From b1fbf5b02280de5b78b0249e777a179e34b50b98 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Fri, 24 Feb 2012 16:16:38 +0530 Subject: formating and identation --- testapp/exam/forms.py | 7 ++ testapp/exam/views.py | 16 ++- testapp/templates/base.html | 135 +++++++++++---------- testapp/templates/exam/add_question.html | 32 +++-- testapp/templates/exam/add_quiz.html | 36 +++--- testapp/templates/exam/complete.html | 37 +++--- testapp/templates/exam/edit_question.html | 38 +++--- testapp/templates/exam/edit_quiz.html | 43 ++++--- testapp/templates/exam/grade_user.html | 4 +- testapp/templates/exam/intro.html | 103 ++++++---------- testapp/templates/exam/login.html | 76 ++++++------ testapp/templates/exam/monitor.html | 53 ++++----- testapp/templates/exam/question.html | 190 ++++++++++++++---------------- testapp/templates/exam/quit.html | 39 +++--- testapp/templates/exam/register.html | 46 ++++---- testapp/templates/exam/show_quiz.html | 39 +++--- testapp/templates/exam/showquestions.html | 40 +++---- testapp/templates/exam/user_data.html | 6 +- testapp/templates/manage.html | 61 +++++----- 19 files changed, 467 insertions(+), 534 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index 1788a08..e622b88 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -18,6 +18,7 @@ UNAME_CHARS = letters + "._" + digits PWD_CHARS = letters + punctuation + digits class UserRegisterForm(forms.Form): + """A Class to create new form for User's Registration. It has the various fields and functions required to register a new user to the system""" username = forms.CharField(max_length=30, help_text='Letters, digits, period and underscores only.') @@ -88,6 +89,8 @@ class UserRegisterForm(forms.Form): return u_name, pwd class UserLoginForm(forms.Form): + """Creates a form which will allow the user to log into the system.""" + username = forms.CharField(max_length = 30) password = forms.CharField(max_length=30, widget=forms.PasswordInput()) @@ -105,6 +108,8 @@ class UserLoginForm(forms.Form): return user class QuizForm(forms.Form): + """Creates a form to add or edit a Quiz. It has the related fields and functions required.""" + start_date = forms.DateField(initial=datetime.date.today) duration = forms.IntegerField() active = forms.BooleanField(required = False) @@ -124,6 +129,8 @@ class QuizForm(forms.Form): new_quiz.save() class QuestionForm(forms.Form): + """Creates a form to add or edit a Question. It has the related fields and functions required.""" + summary = forms.CharField(max_length = 128) description = forms.CharField(widget = forms.Textarea(attrs={'cols': 20, 'rows': 3})) points = forms.FloatField() diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 6eea338..2803538 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -93,6 +93,8 @@ def user_register(request): context_instance=RequestContext(request)) def edit_quiz(request): + """Edit the list of quizzes seleted by the user for editing.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404('You are not allowed to view this page!') @@ -114,6 +116,7 @@ def edit_quiz(request): return my_redirect("/exam/manage/showquiz/") def edit_question(request): + """Edit the list of quizzes seleted by the user for editing.""" user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404('You are not allowed to view this page!') @@ -142,6 +145,7 @@ def edit_question(request): def add_question(request,question_id=None): """To add a new question in the database. Create a new question and store it.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404('You are not allowed to view this page!') @@ -192,6 +196,8 @@ def add_question(request,question_id=None): def add_quiz(request,quiz_id=None): + """To add a new quiz in the database. Create a new question and store it.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404('You are not allowed to view this page!') @@ -237,6 +243,7 @@ def add_quiz(request,quiz_id=None): def prof_manage(request): """Take credentials of the user with professor/moderator rights/permissions and log in.""" + user = request.user if user.is_authenticated() and user.groups.filter(name='moderator').count() > 0: return render_to_response('manage.html',{}) @@ -340,6 +347,7 @@ def question(request, q_id): def show_question(request, q_id): """Show a question if possible.""" + if len(q_id) == 0: msg = 'Congratulations! You have successfully completed the quiz.' return complete(request, msg) @@ -347,7 +355,7 @@ def show_question(request, q_id): return question(request, q_id) def check(request, q_id): - + """Checks the answers of the user for particular question""" user = request.user if not user.is_authenticated(): @@ -432,8 +440,8 @@ def complete(request,reason = None): return my_redirect('/exam/') def monitor(request, quiz_id=None): - """Monitor the progress of the papers taken so far.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page!') @@ -479,6 +487,7 @@ def get_user_data(username): def show_all_users(request): """Shows all the users who have taken various exams/quiz.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page !') @@ -489,6 +498,7 @@ def show_all_users(request): def show_all_quiz(request): """Generates a list of all the quizzes that are currently in the database.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page !') @@ -548,6 +558,7 @@ def show_all_quiz(request): def show_all_questions(request): """Show a list of all the questions currently in the databse.""" + user = request.user if not user.is_authenticated() or user.groups.filter(name='moderator').count() == 0 : raise Http404("You are not allowed to view this page !") @@ -608,6 +619,7 @@ def show_all_questions(request): def user_data(request, username): """Render user data.""" + current_user = request.user if not current_user.is_authenticated() or current_user.groups.filter(name='moderator').count() == 0: raise Http404('You are not allowed to view this page!') diff --git a/testapp/templates/base.html b/testapp/templates/base.html index 54a2035..49fc7ce 100644 --- a/testapp/templates/base.html +++ b/testapp/templates/base.html @@ -2,84 +2,83 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + + + {% block title %} + {% endblock %} + - -{% block title %} -{% endblock %} - + {% block meta %} + + + + {% endblock %} -{% block meta %} - - - -{% endblock %} - - - -{% block css %} - + {% endblock %} - .content .span10, - .content .span14 { - min-height: 500px; - } - - .content .span4 { - margin-left: 0; - padding-left: 19px; - border-left: 1px solid #eee; - } - - .topbar .btn { - border: 0; - } - - -{% endblock %} - -{% block script %} -{% endblock %} - + {% block script %} + {% endblock %} +
-{% block content %} -{% endblock %} + {% block content %} + {% endblock %}
- diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index 2d42b34..d5503b5 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -1,27 +1,25 @@ {% extends "manage.html" %} -{% block subtitle %} -Add Question -{% endblock %} +{% block subtitle %}Add Question{% endblock %} {% block manage %} - + -{% csrf_token %} -
-{{ form.as_table }} -
-
-
+ {% csrf_token %} +
+ {{ form.as_table }} +
+
+
{% endblock %} diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index d51d129..4dae30b 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -1,28 +1,26 @@ {% extends "manage.html" %} -{% block subtitle %} -Add Quiz -{% endblock %} +{% block subtitle %}Add Quiz{% endblock %} {% block manage %} + -
-{% csrf_token %} -
- -{{ form.as_table }} -
-
-
-
+ {% csrf_token %} +
+ + {{ form.as_table }} +
+
+
+
{% endblock %} diff --git a/testapp/templates/exam/complete.html b/testapp/templates/exam/complete.html index 6a401a4..f5c658f 100644 --- a/testapp/templates/exam/complete.html +++ b/testapp/templates/exam/complete.html @@ -3,26 +3,21 @@ {% block title %}Good bye!{% endblock %} {% block content %} - - -
-
- -
-
- -

Good bye!

- -

{{message}}

- -

You may now close the browser.

- -
-
-

© FOSSEE group, IIT Bombay

-
+
+
+ +
+
+

Good bye!

+

{{message}}

+

You may now close the browser.

+
+
+
+
+

© FOSSEE group, IIT Bombay

+
- {% endblock content %} diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html index 04217ab..7613cc6 100644 --- a/testapp/templates/exam/edit_question.html +++ b/testapp/templates/exam/edit_question.html @@ -1,29 +1,27 @@ {% extends "manage.html" %} -{% block subtitle %} -Edit Question -{% endblock %} +{% block subtitle %}Edit Question{% endblock %} {% block manage %} - +
-{% csrf_token %} -{% for form in forms %} - -{{ form.as_table }} -
-
-{% endfor %} -
-
+ {% csrf_token %} + {% for form in forms %} + + {{ form.as_table }} +
+
+ {% endfor %} +
+
{% endblock %} diff --git a/testapp/templates/exam/edit_quiz.html b/testapp/templates/exam/edit_quiz.html index 7744623..27b179f 100644 --- a/testapp/templates/exam/edit_quiz.html +++ b/testapp/templates/exam/edit_quiz.html @@ -1,31 +1,28 @@ {% extends "manage.html" %} -{% block subtitle %} -Edit Quiz(zes) -{% endblock %} +{% block subtitle %}Edit Quiz(zes){% endblock %} {% block manage %} - - +
-{% csrf_token %} -{% for form in forms %} -
- -{{ form.as_table }} -
-
-
-{% endfor %} -
-
+ {% csrf_token %} + {% for form in forms %} +
+ + {{ form.as_table }} +
+
+
+ {% endfor %} +
+
{% endblock %} diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index bad1765..5b0e1a7 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -71,8 +71,7 @@ Marks: 1 %} - - Monitor quiz +Monitor quiz {% else %} {% with data.papers.0 as paper %} @@ -81,5 +80,4 @@ Marks: Admin - {% endblock%} diff --git a/testapp/templates/exam/intro.html b/testapp/templates/exam/intro.html index 35a6923..167a4b2 100644 --- a/testapp/templates/exam/intro.html +++ b/testapp/templates/exam/intro.html @@ -3,68 +3,43 @@ {% block title %}Instructions and Rules {% endblock %} {% block content %} - -
-
- -
-
-

Important instructions & rules


- -

Welcome {{user.first_name.title}} {{user.last_name.title}}, -to the programming quiz!

- -

-This examination system has been developed with the intention of making you -learn programming and be assessed in an interactive and fun manner. -You will be presented with a series of programming questions and problems that -you will answer online and get immediate feedback for. -

- -

Here are some important instructions and rules that you should understand -carefully. -

- -
    - -
  • For any programming questions, you can submit solutions as many times as - you want without a penalty. You may skip questions and solve them later. -
  • - -
  • You may use your computer's Python/IPython shell or - an editor to solve - the problem and cut/paste the solution to the web interface. -
  • - -
  • You are not allowed to use any internet - resources, i.e. no google etc.
  • - -
  • Do not copy or share the questions or answers with anyone until the - exam is complete for everyone.
  • - -
  • All your attempts at the questions are logged. - Do not try to outsmart and break the testing system. If you do, we know - who you are and we will expell you from the course. You have been warned. -
  • - -
- -

We hope you enjoy taking this exam !!!

- -
-{% csrf_token %} -
- -
-
-
-
-
-

© FOSSEE group, IIT Bombay

-
- -
- +
+
+ +
+
+

Important instructions & rules


+

Welcome {{user.first_name.title}} {{user.last_name.title}}, to the programming quiz!

+

+ This examination system has been developed with the intention of making you + learn programming and be assessed in an interactive and fun manner. + You will be presented with a series of programming questions and problems that + you will answer online and get immediate feedback for. +

+

Here are some important instructions and rules that you should understand carefully.

+
    +
  • For any programming questions, you can submit solutions as many times as you want without a penalty. You may skip questions and solve them later. +
  • +
  • You may use your computer's Python/IPython shell or an editor to solve the problem and cut/paste the solution to the web interface. +
  • +
  • You are not allowed to use any internet resources, i.e. no google etc.
  • +
  • Do not copy or share the questions or answers with anyone until the exam is complete for everyone.
  • +
  • All your attempts at the questions are logged. Do not try to outsmart and break the testing system. If you do, we know who you are and we will expell you from the course. You have been warned. +
  • +
+

We hope you enjoy taking this exam !!!

+ +
+ {% csrf_token %} +
+
+
+
+
+
+

© FOSSEE group, IIT Bombay

+
+
{% endblock content %} diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html index 62aedcf..07a91fc 100644 --- a/testapp/templates/exam/login.html +++ b/testapp/templates/exam/login.html @@ -3,46 +3,40 @@ {% block title %}Login{% endblock title %} {% block content %} - -
-
- -
-
-

Login


-
-{% csrf_token %} - - -
-{{ form.as_table }} -
- -
    
-
Forgot Password?

-
New User? Sign-Up
-
+
+
+ +
+
+

Login


+
+ {% csrf_token %} + +
+ {{ form.as_table }} +
+
    
+
Forgot Password?

+
New User? Sign-Up
+
+
+
+
+
+

© FOSSEE group, IIT Bombay

+
-
-
-
-

© FOSSEE group, IIT Bombay

-
- -
- - {% endblock content %} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index 60814c7..a0287e7 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -6,18 +6,15 @@ {% block manage %} -{% if not quizzes and not quiz %} -

Quiz results

- -
No quizzes available.
- -{% endif %} + {% if not quizzes and not quiz %} +

Quiz results

+
No quizzes available.
+ {% endif %} {# ############################################################### #} {# This is rendered when we are just viewing exam/monitor #} {% if quizzes %}

Available quizzes

-
    {% for quiz in quizzes %}
  • {{ quiz.description }}
  • @@ -33,32 +30,32 @@ {% if papers %} {#

    Quiz: {{ quiz_name }}

    #}

    Number of papers: {{ papers|length }}

    - + - - - - - - - + + + + + + + {% for paper in papers %} - - + + diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html index a02e8c4..113a9ae 100644 --- a/testapp/templates/exam/question.html +++ b/testapp/templates/exam/question.html @@ -1,117 +1,103 @@ {% extends "base.html" %} + - {% block title %} Answer question {% endblock %} +{% block title %} Answer question {% endblock %} {% block script %} - + {% endblock script %} {% block onload %} onload="update_time()" {% endblock onload %} {% block content %} -
    -
    -
    -

    Online Test

    - - -
    - {% csrf_token %} - - -
    -
    -
    +
    +
    +

    Online Test

    +
    + {% csrf_token %} + + +
    +
    +
    -
    - -
    -
    - -

    {{ question.summary }}

    -
    {{ question.description|safe }}
    -
    (Marks : {{ question.points }})
    - - -{% if error_message %}
    ERROR:
    {{ error_message }}
    {% endif %} - -

    - -
    -{% csrf_token %} -{% if question.type == "mcq" %} -{% for option in question.options.strip.splitlines %} -{{option}}
    -{% endfor %} -{% else %} - -{% endif %} - -{% if question.type == "mcq" %} -
       - -{% else %} -   - -{% endif %} - - - - -
    {{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }}
    - -

    Time left:

    - -
    - -
    -
    -

    © FOSSEE group, IIT Bombay

    -
    +
    + +
    +
    +

    {{ question.summary }}

    +
    {{ question.description|safe }}
    +
    (Marks : {{ question.points }})
    + {% if error_message %}
    ERROR:
    {{ error_message }}
    {% endif %} +

    +
    + {% csrf_token %} + {% if question.type == "mcq" %} + {% for option in question.options.strip.splitlines %} + {{option}}
    + {% endfor %} + {% else %} + + {% endif %} + + {% if question.type == "mcq" %} +
       + {% else %} +    + {% endif %} + + +
    {{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }}
    +

    Time left:

    +
    +
    +
    +
    +
    +

    © FOSSEE group, IIT Bombay

    +
    - {% endblock content %} diff --git a/testapp/templates/exam/quit.html b/testapp/templates/exam/quit.html index 3ee85db..118ea07 100644 --- a/testapp/templates/exam/quit.html +++ b/testapp/templates/exam/quit.html @@ -2,28 +2,25 @@ {% block title %}Quit exam {% endblock %} - - {% block content %} -
    -
    - -
    -
    -

    Your current answers are saved.

    -

    Are you sure you wish to quit the exam?

    -
    - {% csrf_token %} -
     
    - -
    -
    -
    -
    -

    © FOSSEE group, IIT Bombay

    -
    +
    + +
    +
    +

    Your current answers are saved.

    +

    Are you sure you wish to quit the exam?

    +
    + {% csrf_token %} +
     
    + +
    +
    +
    +
    +

    © FOSSEE group, IIT Bombay

    +
    {% endblock content %} diff --git a/testapp/templates/exam/register.html b/testapp/templates/exam/register.html index 1555ab3..e416470 100644 --- a/testapp/templates/exam/register.html +++ b/testapp/templates/exam/register.html @@ -3,32 +3,26 @@ {% block title %}Registration form {% endblock %} {% block content %} - -
    -
    - -
    -
    +
    +
    + +
    +

    Please fill in the following details


    - -
    -{% csrf_token %} -
    Name Username Roll number Institute Questions answered Total marks Attempts Name Username Roll number Institute Questions answered Total marks Attempts
    - {{ paper.user.get_full_name.title }} - {{ paper.user.username }} {{ paper.user.get_full_name.title }} {{ paper.user.username }} {{ paper.profile.roll_number }} {{ paper.profile.institute }} {{ paper.get_answered_str }}
    -{{ form.as_table }} -
-
  
- +
+ {% csrf_token %} +
+ {{ form.as_table }} +
+
  
+
+
+
+
+
+

© FOSSEE group, IIT Bombay

+
-
-
- -
-

© FOSSEE group, IIT Bombay

-
- -
- - {% endblock content %} diff --git a/testapp/templates/exam/show_quiz.html b/testapp/templates/exam/show_quiz.html index d546b06..e6aecd6 100644 --- a/testapp/templates/exam/show_quiz.html +++ b/testapp/templates/exam/show_quiz.html @@ -3,33 +3,31 @@ {% block title %} Quiz List {% endblock title %} {% block script %} - + } + {% endblock %} {% block manage %} @@ -46,13 +44,14 @@ function confirm_edit(frm) {% csrf_token %} {% for quiz in quizzes %} -   {{ quiz.description }}
{% endfor %} +

      {% endif %} + {% endblock %} diff --git a/testapp/templates/exam/showquestions.html b/testapp/templates/exam/showquestions.html index edcba6f..116e747 100644 --- a/testapp/templates/exam/showquestions.html +++ b/testapp/templates/exam/showquestions.html @@ -1,37 +1,34 @@ {% extends "manage.html" %} -{% block subtitle %} -List of Questions -{% endblock %} +{% block subtitle %}List of Questions {% endblock %} {% block script %} - + } + {% endblock %} {% block manage %} @@ -44,6 +41,5 @@ function confirm_edit(frm)       - {% endblock %} diff --git a/testapp/templates/exam/user_data.html b/testapp/templates/exam/user_data.html index 943dfe8..fad0310 100644 --- a/testapp/templates/exam/user_data.html +++ b/testapp/templates/exam/user_data.html @@ -70,12 +70,10 @@ User IP address: {{ paper.user_ip }} Grade/correct paper
{% if data.papers.count > 1 %} - - Monitor quiz +Monitor quiz {% else %} {% with data.papers.0 as paper %} - - Monitor quiz +Monitor quiz {% endwith %} {% endif %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index 10842c3..a2941b0 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -3,47 +3,42 @@ {% block title %}Manage{% endblock title %} {% block content %} -
-
-

{% block subtitle %} {% endblock %}


- {% block manage %} - {% endblock %} -
- - -
-
Manage
- -
+ } + +
+
Manage
+ +
-
-
-

© FOSSEE group, IIT Bombay

-
- -
- - +
+
+

© FOSSEE group, IIT Bombay

+
+
{% endblock content %} -- cgit From b7ad768a6cc4fe5c8a05e20b1968f13a678c22cc Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Tue, 28 Feb 2012 12:09:28 +0530 Subject: changes to remove the inline css from every page --- testapp/static/exam/css/base.css | 42 +++++++++++++-- testapp/static/exam/css/gradeuser.css | 6 +++ testapp/static/exam/css/login.css | 10 ++++ testapp/static/exam/css/monitor.css | 11 ++++ testapp/static/exam/css/question_quiz.css | 9 ++++ testapp/templates/base.html | 78 +++++++--------------------- testapp/templates/exam/add_question.html | 12 ++--- testapp/templates/exam/add_quiz.html | 13 ++--- testapp/templates/exam/complete.html | 16 +----- testapp/templates/exam/edit_question.html | 14 ++--- testapp/templates/exam/edit_quiz.html | 12 ++--- testapp/templates/exam/grade_user.html | 11 ++-- testapp/templates/exam/intro.html | 19 ++----- testapp/templates/exam/login.html | 36 +++---------- testapp/templates/exam/monitor.html | 15 ++---- testapp/templates/exam/question.html | 23 +++------ testapp/templates/exam/quit.html | 17 +----- testapp/templates/exam/register.html | 36 +++++-------- testapp/templates/manage.html | 86 ++++++++++++++++++------------- 19 files changed, 205 insertions(+), 261 deletions(-) create mode 100644 testapp/static/exam/css/gradeuser.css create mode 100644 testapp/static/exam/css/login.css create mode 100644 testapp/static/exam/css/monitor.css create mode 100644 testapp/static/exam/css/question_quiz.css diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index 9a37d2f..d2b227f 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -1,6 +1,8 @@ html, body { + background-color: #eee; margin: 0; padding: 0; + } h1, h2, @@ -168,20 +170,53 @@ textarea { * Basic and global styles for generating a grid system, structural layout, and page templates * ------------------------------------------------------------------------------------------- */ body { - background-color: #ffffff; + padding-top : 10px; + background-color: #eee; margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 18px; color: #404040; + } .container { - width: 940px; + width: 820px; margin-left: auto; margin-right: auto; zoom: 1; } +.container > footer p { + text-align: center; +} +.container > .content { + background-color: #fff; + padding: 20px; + margin: 0 -20px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15); + -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15); + box-shadow: 0 1px 2px rgba(0,0,0,.15); +} +.content .span10, +.content .span14 { + min-height: 500px; +} +.content .span4 { + margin-left: 0; + padding-left: 19px; + border-left: 1px solid #eee; +} +.topbar .btn { + border: 0; +} +.page-header { + background-color: #f5f5f5; + padding: 20px 20px 10px; + margin: -20px -20px 20px; +} .container:before, .container:after { display: table; content: ""; @@ -263,6 +298,7 @@ a:hover { width: 160px; } .span4 { + min-height : 500px; width: 220px; } .span5 { @@ -281,7 +317,7 @@ a:hover { width: 520px; } .span10 { - width: 580px; + width: 560px; } .span11 { width: 640px; diff --git a/testapp/static/exam/css/gradeuser.css b/testapp/static/exam/css/gradeuser.css new file mode 100644 index 0000000..e50ab4e --- /dev/null +++ b/testapp/static/exam/css/gradeuser.css @@ -0,0 +1,6 @@ +textarea +{ +width : 550px; +height : 200px; + +} diff --git a/testapp/static/exam/css/login.css b/testapp/static/exam/css/login.css new file mode 100644 index 0000000..a10cbaa --- /dev/null +++ b/testapp/static/exam/css/login.css @@ -0,0 +1,10 @@ +label +{ + padding-top: 6px; + font-size: 15px; + line-height: 18px; + float: left; + width: 80px; + text-align: center; + color: #404040; + } diff --git a/testapp/static/exam/css/monitor.css b/testapp/static/exam/css/monitor.css new file mode 100644 index 0000000..b16c8b3 --- /dev/null +++ b/testapp/static/exam/css/monitor.css @@ -0,0 +1,11 @@ + table td + { + vertical-align: top; + border-top: 1px solid #ddd; + } + table tbody th + { + border-top: 1px solid #ddd; + vertical-align: top; + } + diff --git a/testapp/static/exam/css/question_quiz.css b/testapp/static/exam/css/question_quiz.css new file mode 100644 index 0000000..2e13364 --- /dev/null +++ b/testapp/static/exam/css/question_quiz.css @@ -0,0 +1,9 @@ +table th, table td + { + text-align: left; + } +textarea +{ +width : 300px; +height : 150px; +} diff --git a/testapp/templates/base.html b/testapp/templates/base.html index 49fc7ce..fed3939 100644 --- a/testapp/templates/base.html +++ b/testapp/templates/base.html @@ -13,62 +13,9 @@ {% endblock %} - - - + + {% block css %} - {% endblock %} {% block script %} @@ -76,9 +23,22 @@ -
- {% block content %} - {% endblock %} -
+
+
+ +
+
+

{% block formtitle %} {% endblock formtitle %}


+ {% block content %} + {% endblock %} +
+
+
+
+

© FOSSEE group, IIT Bombay

+
+
diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index d5503b5..59a1d64 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -2,17 +2,11 @@ {% block subtitle %}Add Question{% endblock %} +{% block css %} + +{% endblock %} {% block manage %} - -
{% csrf_token %}
diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index 4dae30b..dedc627 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -3,16 +3,11 @@ {% block subtitle %}Add Quiz{% endblock %} -{% block manage %} - +{% block css %} + +{% endblock %} +{% block manage %} {% csrf_token %}
diff --git a/testapp/templates/exam/complete.html b/testapp/templates/exam/complete.html index f5c658f..dfeee6c 100644 --- a/testapp/templates/exam/complete.html +++ b/testapp/templates/exam/complete.html @@ -2,22 +2,10 @@ {% block title %}Good bye!{% endblock %} +{% block pagetitle %}Online Test{% endblock %} {% block content %} -
-
- -
-
+

Good bye!

{{message}}

You may now close the browser.

-
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
{% endblock content %} diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html index 7613cc6..6a4f1ec 100644 --- a/testapp/templates/exam/edit_question.html +++ b/testapp/templates/exam/edit_question.html @@ -2,21 +2,15 @@ {% block subtitle %}Edit Question{% endblock %} +{% block css %} + +{% endblock %} {% block manage %} - - {% csrf_token %} {% for form in forms %} -
+
{{ form.as_table }}

diff --git a/testapp/templates/exam/edit_quiz.html b/testapp/templates/exam/edit_quiz.html index 27b179f..56eb0c0 100644 --- a/testapp/templates/exam/edit_quiz.html +++ b/testapp/templates/exam/edit_quiz.html @@ -3,15 +3,11 @@ {% block subtitle %}Edit Quiz(zes){% endblock %} +{% block css %} + +{% endblock %} + {% block manage %} - {% csrf_token %} {% for form in forms %} diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 5b0e1a7..fccdaaa 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -3,6 +3,10 @@ {% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %} {% block subtitle %}Grading papers for {{ data.user.get_full_name.title }}{% endblock %} + +{% block css %} + +{% endblock %} {% block manage %} @@ -32,12 +36,13 @@ Start time: {{ paper.start_time }}
{% if paper.answers.count %}

Answers


+ action="{{URL_ROOT}}/exam/manage/gradeuser/{{data.user.username}}/" method="post"> {% csrf_token %} {% for question, answers in paper.get_question_answers.items %}

- - Question: {{ question.id }}. {{ question.summary }} + + Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})

{% if question.type == "mcq" %}

Choices: diff --git a/testapp/templates/exam/intro.html b/testapp/templates/exam/intro.html index 167a4b2..ef218a2 100644 --- a/testapp/templates/exam/intro.html +++ b/testapp/templates/exam/intro.html @@ -3,14 +3,10 @@ {% block title %}Instructions and Rules {% endblock %} {% block content %} -

-
- -
-
-

Important instructions & rules


+ +{% block pagetitle %}Online Test {% endblock %} +{% block formtitle %}Important instructions & rules {% endblock %} +

Welcome {{user.first_name.title}} {{user.last_name.title}}, to the programming quiz!

This examination system has been developed with the intention of making you @@ -35,11 +31,4 @@ {% csrf_token %}

-
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
{% endblock content %} diff --git a/testapp/templates/exam/login.html b/testapp/templates/exam/login.html index 07a91fc..078e7a7 100644 --- a/testapp/templates/exam/login.html +++ b/testapp/templates/exam/login.html @@ -1,30 +1,16 @@ {% extends "base.html" %} {% block title %}Login{% endblock title %} - +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %}Login{% endblock %} +{% block css %} + +{% endblock %} {% block content %} -
-
- -
-
-

Login


+
{% csrf_token %} - +
{{ form.as_table }}
@@ -32,11 +18,5 @@
Forgot Password?

New User? Sign-Up
-
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
+ {% endblock content %} diff --git a/testapp/templates/exam/monitor.html b/testapp/templates/exam/monitor.html index a0287e7..9385e73 100644 --- a/testapp/templates/exam/monitor.html +++ b/testapp/templates/exam/monitor.html @@ -4,6 +4,9 @@ {% block meta %} {% endblock meta %} +{% block css %} + +{% endblock %} {% block manage %} {% if not quizzes and not quiz %} @@ -30,18 +33,6 @@ {% if papers %} {#

Quiz: {{ quiz_name }}

#}

Number of papers: {{ papers|length }}

- diff --git a/testapp/templates/exam/question.html b/testapp/templates/exam/question.html index 113a9ae..f5dcdf4 100644 --- a/testapp/templates/exam/question.html +++ b/testapp/templates/exam/question.html @@ -48,6 +48,7 @@ {% block onload %} onload="update_time()" {% endblock onload %} +{% block pagetitle %}

Test for {{ user.first_name.title }} {{ user.last_name.title }}

{% endblock %} {% block content %}
@@ -61,16 +62,10 @@
-
-
- -
-
-

{{ question.summary }}

-
{{ question.description|safe }}
-
(Marks : {{ question.points }})
+ +

{{ question.summary }} (Marks : {{ question.points }})


+ {{ question.description|safe }} + {% if error_message %}
ERROR:
{{ error_message }}
{% endif %}

@@ -93,11 +88,5 @@
{{ user.first_name.title }} {{ user.last_name.title }}, You have {{ paper.questions_left }} question(s) left in {{ quiz_name }}

Time left:


-
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
+ {% endblock content %} diff --git a/testapp/templates/exam/quit.html b/testapp/templates/exam/quit.html index 118ea07..40a0a92 100644 --- a/testapp/templates/exam/quit.html +++ b/testapp/templates/exam/quit.html @@ -1,26 +1,13 @@ {% extends "base.html" %} {% block title %}Quit exam {% endblock %} - +{% block pagetitle %}Online Test {% endblock %} {% block content %} -
-
- -
-
+

Your current answers are saved.

Are you sure you wish to quit the exam?

{% csrf_token %}
 
-
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
{% endblock content %} diff --git a/testapp/templates/exam/register.html b/testapp/templates/exam/register.html index e416470..5ff79cc 100644 --- a/testapp/templates/exam/register.html +++ b/testapp/templates/exam/register.html @@ -2,27 +2,19 @@ {% block title %}Registration form {% endblock %} +{% block pagetitle %}Online Test {% endblock %} +{% block formtitle %}Please fill in the following details {% endblock %} + {% block content %} -
-
- -
-
-

Please fill in the following details


-
- {% csrf_token %} -
Name
- {{ form.as_table }} -
-
  
- -
-
-
-
-

© FOSSEE group, IIT Bombay

-
-
+ + + +
+ {% csrf_token %} +
+ {{ form.as_table }} +
+
  
+
+ {% endblock content %} diff --git a/testapp/templates/manage.html b/testapp/templates/manage.html index a2941b0..9995450 100644 --- a/testapp/templates/manage.html +++ b/testapp/templates/manage.html @@ -1,44 +1,56 @@ -{% extends "base.html" %} + -{% block title %}Manage{% endblock title %} + + + + {% block title %} + {% endblock %} + -{% block content %} -
-
- + {% block meta %} + + + + {% endblock %} + + + {% block css %} + {% endblock %} -
-
-

{% block subtitle %} {% endblock %}


- {% block manage %} - {% endblock %} -
- -
+ {% block script %} + {% endblock %} + + + + +
+
+ +
+
+

{% block subtitle %} {% endblock %}


+ {% block manage %} + {% endblock %} +
+ -
-
-
-

© FOSSEE group, IIT Bombay

-
-
-{% endblock content %} +
+
+
+
+

© FOSSEE group, IIT Bombay

+
+
+ + + -- cgit From 7660073c5c83534a869f685b27c0fe0152b9983c Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Tue, 28 Feb 2012 18:14:17 +0530 Subject: Minor changes for displaying question details in grade_user and licensing in css --- testapp/static/exam/css/base.css | 20 ++++++++++++++++++ testapp/static/exam/css/gradeuser.css | 32 +++++++++++++++++++++++++++++ testapp/templates/exam/grade_user.html | 37 ++++++++++++++++++++++++++++++---- 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index d2b227f..b7a9fbb 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -1,3 +1,23 @@ +/*! +Copyright 2012 Twitter, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + * Bootstrap v1.4.0 + * + * Copyright 2011 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + * Date: Sun Dec 25 20:18:31 PST 2011 + */ +/* Reset.less + * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). + * For Online Test Application, this CSS was changed as per the requirements wherever required. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ + html, body { background-color: #eee; margin: 0; diff --git a/testapp/static/exam/css/gradeuser.css b/testapp/static/exam/css/gradeuser.css index e50ab4e..3f7baf9 100644 --- a/testapp/static/exam/css/gradeuser.css +++ b/testapp/static/exam/css/gradeuser.css @@ -4,3 +4,35 @@ width : 550px; height : 200px; } + +#headerDiv, #contentDiv { +float: left; +width: 510px; +} +#titleText { +float: left; +font-size: 1.1em; +font-weight: bold; +margin: 5px; +} +#myHeader { +font-size: 1.1em; +font-weight: bold; +margin: 5px; +} +#headerDiv { +background-color: #0037DB; +color: #9EB6FF; +} +#contentDiv { +background-color:#F0F8FF; +} +#myContent { +margin: 5px 10px; +} +#headerDiv a { +float: right; +margin: 10px 10px 5px 5px; +} +#headerDiv a:hover { +color: #FFFFFF; diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index fccdaaa..5d3aa58 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -8,6 +8,22 @@ {% endblock %} +{% block script %} + +{% endblock %} {% block manage %}

@@ -35,14 +51,25 @@ Start time: {{ paper.start_time }}
{% if paper.answers.count %}

Answers


-
{% csrf_token %} {% for question, answers in paper.get_question_answers.items %}

- - Question: {{ question.id }}. {{ question.summary }} + Question: {{ question.id }}. {{ question.summary }} +

+
+ +
+ + (Points: {{ question.points }})

{% if question.type == "mcq" %}

Choices: @@ -62,6 +89,8 @@ Marks:

{% endwith %} {% endfor %} {# for question, answers ... #} + +

Teacher comments:

-- cgit From 87862b8c8d7822a4578b5cb5f413bedb37454bd2 Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Wed, 29 Feb 2012 13:14:00 +0530 Subject: minor changes for rendering question(s) --- testapp/templates/exam/add_question.html | 17 +++++++++++++++-- testapp/templates/exam/edit_question.html | 19 +++++++++++++++++-- testapp/templates/exam/grade_user.html | 4 ++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index 59a1d64..8bccb66 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -2,18 +2,31 @@ {% block subtitle %}Add Question{% endblock %} +{% block script %} + +{% endblock %} {% block css %} {% endblock %} {% block manage %} - + {% csrf_token %} +Look of Question in HTML Format : +

+
{{ form.as_table }}
+
-{% endblock %} +{% endblock %} diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html index 6a4f1ec..a189ac5 100644 --- a/testapp/templates/exam/edit_question.html +++ b/testapp/templates/exam/edit_question.html @@ -5,11 +5,25 @@ {% block css %} {% endblock %} - +{% block script %} + +{% endblock %} {% block manage %} -
+ {% csrf_token %} + {% for form in forms %} +Look of Question in HTML Format : +

{{ form.as_table }}
@@ -19,3 +33,4 @@
{% endblock %} + diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 5d3aa58..b7970e8 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -56,7 +56,7 @@ Start time: {{ paper.start_time }}
{% csrf_token %} {% for question, answers in paper.get_question_answers.items %}

- Question: {{ question.id }}. {{ question.summary }} + Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})

- (Points: {{ question.points }})

+ {% if question.type == "mcq" %}

Choices: {% for option in question.options.strip.splitlines %} {{option}}, {% endfor %} -- cgit From a7c84a478789e9e835dcbb3ea41b1d519ba69b4d Mon Sep 17 00:00:00 2001 From: jayparikh111 Date: Tue, 13 Mar 2012 18:44:01 +0530 Subject: minor changes for UI --- testapp/exam/forms.py | 2 +- testapp/exam/views.py | 3 ++- testapp/static/exam/css/base.css | 5 ++-- testapp/static/exam/css/question_quiz.css | 6 +---- testapp/templates/exam/add_quiz.html | 14 +++++++++-- testapp/templates/exam/edit_question.html | 40 +++++++++++++++++++++++++++++-- testapp/templates/exam/edit_quiz.html | 21 ++++++++++++---- testapp/templates/exam/grade_user.html | 29 ++++++++++++---------- testapp/templates/exam/monitor.html | 18 +++++++++----- testapp/templates/exam/show_quiz.html | 5 ++-- testapp/templates/exam/user_data.html | 4 ++-- testapp/templates/manage.html | 31 +++++++++++++----------- 12 files changed, 122 insertions(+), 56 deletions(-) diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index e622b88..272a3d4 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -113,7 +113,7 @@ class QuizForm(forms.Form): start_date = forms.DateField(initial=datetime.date.today) duration = forms.IntegerField() active = forms.BooleanField(required = False) - description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':2})) + description = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'cols':20,'rows':1})) def save(self): start_date = self.cleaned_data["start_date"] diff --git a/testapp/exam/views.py b/testapp/exam/views.py index 2803538..ffb1b1e 100644 --- a/testapp/exam/views.py +++ b/testapp/exam/views.py @@ -246,7 +246,8 @@ def prof_manage(request): user = request.user if user.is_authenticated() and user.groups.filter(name='moderator').count() > 0: - return render_to_response('manage.html',{}) + context = {'user':user} + return render_to_response('manage.html',context) return my_redirect('/exam/login/') def user_login(request): diff --git a/testapp/static/exam/css/base.css b/testapp/static/exam/css/base.css index b7a9fbb..7099aab 100644 --- a/testapp/static/exam/css/base.css +++ b/testapp/static/exam/css/base.css @@ -1845,8 +1845,9 @@ footer { -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } -.page-header h1 { - margin-bottom: 8px; +.page-header h3 { + margin-top: 20px; + margin-bottom : -17px; } .btn.danger, .alert-message.danger, diff --git a/testapp/static/exam/css/question_quiz.css b/testapp/static/exam/css/question_quiz.css index 2e13364..643e5c6 100644 --- a/testapp/static/exam/css/question_quiz.css +++ b/testapp/static/exam/css/question_quiz.css @@ -2,8 +2,4 @@ table th, table td { text-align: left; } -textarea -{ -width : 300px; -height : 150px; -} + diff --git a/testapp/templates/exam/add_quiz.html b/testapp/templates/exam/add_quiz.html index dedc627..fe99ce6 100644 --- a/testapp/templates/exam/add_quiz.html +++ b/testapp/templates/exam/add_quiz.html @@ -6,9 +6,18 @@ {% block css %} {% endblock %} +{% block script %} + +{% endblock %} +{% block onload %} onload="javascript:test();" {% endblock %} {% block manage %} -

+ {% csrf_token %}
@@ -16,6 +25,7 @@
-
+ +
{% endblock %} diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html index a189ac5..b1395e9 100644 --- a/testapp/templates/exam/edit_question.html +++ b/testapp/templates/exam/edit_question.html @@ -15,15 +15,49 @@ function my_render(frm) } } +function load_form() +{ + +} + +function data(showContent,showHideDiv) +{ + var con = document.getElementById(showContent); + var ele=document.getElementById(showHideDiv); + if (ele.style.display=="block") + { + con.style.display = "none" + ele.style.display = "none"; + } + else + { + con.style.display = "block"; + ele.style.display = "block"; + } +} {% endblock %} +{% block onload %} onload='javascript:load_form();' {% endblock %} {% block manage %}
{% csrf_token %} - {% for form in forms %} -Look of Question in HTML Format : + {% for form in forms %} + + {{ form.summary.value }}Show
+ Look of Question in HTML Format :

+
+ +
+
+ {% endfor %} + + {% for form in forms %} + {{ form.as_table }}
@@ -32,5 +66,7 @@ function my_render(frm)
+ + {% endblock %} diff --git a/testapp/templates/exam/edit_quiz.html b/testapp/templates/exam/edit_quiz.html index 56eb0c0..d513e7a 100644 --- a/testapp/templates/exam/edit_quiz.html +++ b/testapp/templates/exam/edit_quiz.html @@ -5,19 +5,30 @@ {% block css %} + {% endblock %} {% block manage %}
{% csrf_token %} - {% for form in forms %}
- - {{ form.as_table }} +
+ + + {% for form in forms %} + + + + {% endfor %}
Start Date Duration Active Description +
{{ form.start_date}} {{ form.duration }} {{ form.active }} {{ form.description }} +
-
- {% endfor %}
diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index b7970e8..c6f6343 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -10,17 +10,20 @@ {% block script %} {% endblock %} @@ -56,9 +59,9 @@ Start time: {{ paper.start_time }}
{% csrf_token %} {% for question, answers in paper.get_question_answers.items %}

- Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})

-
-
+ Question: {{ question.id }}. {{ question.summary }} ... + (Points: {{ question.points }})

+