mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 17:46:05 +02:00
better homework checking for tutorial up to page 6
This commit is contained in:
parent
322a87b1d0
commit
8c5b9a803d
5 changed files with 67 additions and 31 deletions
|
@ -4,10 +4,10 @@
|
|||
<!-- Check out your site at <a href="">victoria.neocities.org</a>. -->
|
||||
</div>
|
||||
<div class="dialogue" style="left: 300px; top: 25px; width: 250px">
|
||||
Let's make your name a heading by putting a <strong>Heading Level 1 tag</strong> around it.
|
||||
Let's make your name a heading by putting the <strong>h1 tag</strong> around it. This helps to visually separate content on your site.
|
||||
</div>
|
||||
<div class="dialogue" style="left: 330px; top: 120px; width: 250px">
|
||||
Change the text to this: <strong><span id="answer"></span></strong>
|
||||
Try using an h1 tag by changing the text to something like this: <strong><span id="answer"></span></strong>
|
||||
and click save.
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,20 +29,16 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
var answer = '<h1>'+sessionStorage.getItem('name')+"'s Website</h1>"
|
||||
|
||||
$('#answer').text(answer)
|
||||
|
||||
function checkHomework() {
|
||||
var html = editor.getValue()
|
||||
var match = '<html.+>.+<body>.+'+answer+'.+</body>.+</html>'
|
||||
var re = new XRegExp(match, 'gis')
|
||||
|
||||
if(html.match(re) === null) {
|
||||
notok("That's not right! Try again.")
|
||||
if(!html.match(/<h1>\S.+<\/h1>/)) {
|
||||
notok("That doesn't look like a header! Try again.")
|
||||
} else {
|
||||
sessionStorage.setItem('tutorialHtml', html)
|
||||
ok('Great, you did it!', '/tutorial/html/4')
|
||||
ok('Nice header!', '/tutorial/html/4')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue