Commit fc4d4c82 by Prem Sichanugrist

Fix section convention and code highlight

parent 5eac6ffa
<section class="text-input"> <section id="jstextline_${id}" class="jstextline">
<input type="text" name="input_${id}" id="input_${id}" value="${value}" <input type="text" name="input_${id}" id="input_${id}" value="${value}"
% if size: % if size:
size="${size}" size="${size}"
% endif % endif
% if dojs == 'math': % if dojs == 'math':
onkeyup="DoUpdateMath('${id}')" onkeyup="DoUpdateMath('${id}')"
% endif % endif
/> />
% if dojs == 'math': % if dojs == 'math':
<span id="display_${id}">`{::}`</span> <span id="display_${id}">`{::}`</span>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
% if state == 'unsubmitted': % if state == 'unsubmitted':
<span class="unanswered" style="display:inline-block;" id="status_${id}"></span> <span class="unanswered" style="display:inline-block;" id="status_${id}"></span>
% elif state == 'correct': % elif state == 'correct':
<span class="correct" id="status_${id}"></span> <span class="correct" id="status_${id}"></span>
% elif state == 'incorrect': % elif state == 'incorrect':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
......
<section class="text-input"> <section id="textbox_${id}" class="textbox">
<textarea rows="30" cols="80" name="input_${id}" id="input_${id}">${value|h}</textarea> <textarea rows="30" cols="80" name="input_${id}" id="input_${id}">${value|h}</textarea>
<span id="answer_${id}"></span> <span id="answer_${id}"></span>
% if state == 'unsubmitted': % if state == 'unsubmitted':
<span class="unanswered" style="display:inline-block;" id="status_${id}"></span> <span class="unanswered" style="display:inline-block;" id="status_${id}"></span>
% elif state == 'correct': % elif state == 'correct':
<span class="correct" id="status_${id}"></span> <span class="correct" id="status_${id}"></span>
% elif state == 'incorrect': % elif state == 'incorrect':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
...@@ -18,17 +18,21 @@ ...@@ -18,17 +18,21 @@
<span class="debug">${msg|n}</span> <span class="debug">${msg|n}</span>
<br/> <br/>
<br/> <br/>
<script>
// Note: We need to make the area follow the CodeMirror for this to <script type="text/javascript" src="${ settings.LIB_URL }CodeMirror/codemirror.js"></script>
// work. <script type="text/javascript" src="${ settings.LIB_URL }CodeMirror/python.js"></script>
$(function(){ <link rel="stylesheet" href="${ settings.LIB_URL }CodeMirror/codemirror.css" />
var cm = CodeMirror.fromTextArea(document.getElementById("input_${id}"), <script>
{'mode':"python"}); // Note: We need to make the area follow the CodeMirror for this to work.
}); $(function(){
</script> var cm = CodeMirror.fromTextArea(document.getElementById("input_${id}"), {
<style type="text/css"> mode: "python"
.CodeMirror {border-style: solid; });
border-width: 1px;} });
</style> </script>
<style type="text/css">
.CodeMirror {border-style: solid;
border-width: 1px;}
</style>
</section> </section>
<section class="text-input"> <section id="textinput_${id}" class="textinput">
<input type="text" name="input_${id}" id="input_${id}" value="${value}" <input type="text" name="input_${id}" id="input_${id}" value="${value}"
% if size: % if size:
size="${size}" size="${size}"
% endif % endif
/> />
<span id="answer_${id}"></span> <span id="answer_${id}"></span>
% if state == 'unsubmitted': % if state == 'unsubmitted':
<span class="unanswered" style="display:inline-block;" id="status_${id}"></span> <span class="unanswered" style="display:inline-block;" id="status_${id}"></span>
% elif state == 'correct': % elif state == 'correct':
<span class="correct" id="status_${id}"></span> <span class="correct" id="status_${id}"></span>
% elif state == 'incorrect': % elif state == 'incorrect':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment