Tempfix for tutorial 2

This commit is contained in:
Kyle Drake 2016-04-15 11:33:47 -07:00
parent a512d9735f
commit 006c5aba8d

View file

@ -35,7 +35,38 @@
function checkHomework() { function checkHomework() {
var html = editor.getValue() var html = editor.getValue()
var match = '<html.+>.+<body>.+'+answer+'.+</body>.+</html>' var match = '<html>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {
notok("You're missing the HTML element tag! Your web site must begin with <html> and end with </html>.")
return
}
/*
var match = '<html.+>.+<body></body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {
notok("You need to add some text inside the &lt;body&gt;&lt;/body&gt;.")
return
}
*/
var match = 'Hello World'
var re = new XRegExp(match, 'gis')
if(html.match(re) !== null) {
notok("Hint: Try changing \"Hello World\" to something else.")
return
}
sessionStorage.setItem('tutorialHtml', html)
ok('Great, you did it!', '/tutorial/html/3')
/*
var match = '<html.+>.+<body>.+</body>.+</html>'
var re = new XRegExp(match, 'gis') var re = new XRegExp(match, 'gis')
if(html.match(re) === null) { if(html.match(re) === null) {
@ -44,5 +75,6 @@
sessionStorage.setItem('tutorialHtml', html) sessionStorage.setItem('tutorialHtml', html)
ok('Great, you did it!', '/tutorial/html/3') ok('Great, you did it!', '/tutorial/html/3')
} }
*/
} }
</script> </script>