Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

CSS reference in incorrect spot not detected #32

Open
amyschoen opened this issue Feb 5, 2020 · 3 comments
Open

CSS reference in incorrect spot not detected #32

amyschoen opened this issue Feb 5, 2020 · 3 comments

Comments

@amyschoen
Copy link
Contributor

amyschoen commented Feb 5, 2020

Bug Report

Current behavior
I purposely added the CSS in the wrong part of the HTML file, and the step completed successfully.

    <head>
        <title>My awesome web page</title>
    </head>

    <link rel="stylesheet" href="style.css">

Reproduction
Steps to reproduce the behavior in the course:

  1. Go to Step 12.
  2. Edit the HTML file to add the link to the CSS file but don't put it in the head block.
  3. The bot replies back with successful completion of this step.

Expected behavior
I would expect that the bot would detect that this is not in the correct spot and give feedback on how to fix it.

Possible solution
If you have suggestions, we'd love to hear them. If not, that's ok too.

Additional context
Learning Lab v0.5.0

/cc @crichID @brianamarie @hectorsector @JasonEtco

@amyschoen amyschoen added the bug Something isn't working label Feb 5, 2020
@brianamarie
Copy link
Contributor

Thank you for opening this issue, @amyschoen. This is a tricky one to fix. As you probably know, the way that Learning Lab is checking for the CSS is with regex.

So far, we've been walking a fine line, trying to balance:

  • Gates that are TOO specific, and block users when the code would function
  • Gates that are not specific enough, and allow users to move on without accomplishing the learning objective

After playing around with a bit of regex, this may be one improvement option: (<link rel="stylesheet" href="style.css">)(.+)?(\n+)?(.+)?(\n+)?(.+)?(<\/head>) (in this part of the config).

@amyschoen
Copy link
Contributor Author

I didn't know that regex was being used, but that makes a lot of sense. What flavor of regex are you using? Is it JS since things are written in node? That should suffice, but could likely be simplified a bit.

@brianamarie
Copy link
Contributor

I didn't know that regex was being used, but that makes a lot of sense. What flavor of regex are you using? Is it JS since things are written in node? That should suffice, but could likely be simplified a bit.

I believe it is JS, but would recommend testing to be sure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants