Implement ace editor for coding

This commit is contained in:
Kyle Drake 2015-12-14 14:55:33 -08:00
parent d422795c04
commit 65bc388ee9
10 changed files with 77 additions and 41 deletions

View file

@ -32,10 +32,9 @@
var answer = storedName+ "'s Website"
$('#studentName').text(storedName)
function checkHomework(editor) {
var html = editor.val()
var match = '<html>.+<body>.+'+answer+'.+</body>.+</html>'
function checkHomework() {
var html = editor.getValue()
var match = '<html.+>.+<body>.+'+answer+'.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -32,10 +32,9 @@
$('#answer').text(answer)
function checkHomework(editor) {
var html = editor.val()
var match = '<html>.+<body>.+'+answer+'.+</body>.+</html>'
function checkHomework() {
var html = editor.getValue()
var match = '<html.+>.+<body>.+'+answer+'.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -9,10 +9,9 @@
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
var match = '<html>.+<body>.+<h1>.+</h1>.+<p>.+</p>.+</body>.+</html>'
function checkHomework() {
var html = editor.getValue()
var match = '<html.+>.+<body>.+<h1>.+</h1>.+<p>.+</p>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -25,11 +25,10 @@ But this isn't!
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
function checkHomework() {
var html = editor.getValue()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html>.+<body>.+<h1>.+</h1>.+<p>.+<a.+href=".+">.+</a>[^.+]?</p>.+</body>.+</html>'
var match = '<html.+>.+<body>.+<h1>.+</h1>.+<p>.+<a.+href=".+">.+</a>[^.+]?</p>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -21,11 +21,11 @@
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
function checkHomework() {
var html = editor.getValue()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html>.+<body>.+<img.+src="/cat.png">.+</body>.+</html>'
var match = '<html.+>.+<body>.+<img.+src="/cat.png">.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -30,11 +30,11 @@
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
function checkHomework() {
var html = editor.getValue()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html>.+<body>.+<ul>.+<li>.+</li>.+</ul>.+</body>.+</html>'
var match = '<html.+>.+<body>.+<ul>.+<li>.+</li>.+</ul>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {

View file

@ -20,11 +20,11 @@
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
function checkHomework() {
var html = editor.getValue()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html>.+<body>.+<ul>.+<li><a.+href=".+">.+</a></li>.+</ul>.+</body>.+</html>'
var match = '<html.+>.+<body>.+<ul>.+<li><a.+href=".+">.+</a></li>.+</ul>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {