diff --git a/views/tutorial/html/2.erb b/views/tutorial/html/2.erb index a5686cfa..4976ba4d 100644 --- a/views/tutorial/html/2.erb +++ b/views/tutorial/html/2.erb @@ -35,7 +35,38 @@ function checkHomework() { var html = editor.getValue() - var match = '.+.+'+answer+'.+.+' + var match = '.+' + + 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 and end with .") + return + } +/* + var match = '.+.+' + + var re = new XRegExp(match, 'gis') + + if(html.match(re) === null) { + notok("You need to add some text inside the <body></body>.") + 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 = '.+.+.+' + var re = new XRegExp(match, 'gis') if(html.match(re) === null) { @@ -44,5 +75,6 @@ sessionStorage.setItem('tutorialHtml', html) ok('Great, you did it!', '/tutorial/html/3') } +*/ }