Created
February 21, 2016 09:30
-
-
Save aziflaj/c17126be13261b53a603 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function $(str) { | |
| return document.querySelector(str); | |
| } | |
| // Test mblidh | |
| var test1 = mblidh(3, 5); | |
| var test2 = mblidh(5, -8); | |
| var test3 = mblidh(0, 0.1); | |
| var mblidh = 0; | |
| if (test1 === 8) { | |
| $(".mbledhje .success").innerHTML = "mblidh(3, 5) kthen 8<br>"; | |
| mblidh++; | |
| } else { | |
| $(".mbledhje .failure").innerHTML = "mblidh(3, 5) duhet te ktheje 8<br>"; | |
| } | |
| if (test2 === -3) { | |
| $(".mbledhje .success").innerHTML += "mblidh(5, -8) kthen -3<br>"; | |
| mblidh++; | |
| } else { | |
| $(".mbledhje .failure").innerHTML = "mblidh(5, -8) duhet te ktheje -3<br>"; | |
| } | |
| if (test3 === 0.1) { | |
| $(".mbledhje .success").innerHTML += "mblidh(0, 0.1) kthen 0.1<br>"; | |
| mblidh++; | |
| } else { | |
| $(".mbledhje .failure").innerHTML = "mblidh(0, 0.1) duhet te ktheje 0.1<br>"; | |
| } | |
| if (mblidh === 3) { | |
| $(".mbledhje > .status__title").style.color = "green"; | |
| } else if (mblidh === 0) { | |
| $(".mbledhje > .status__title").style.color = "red"; | |
| } else { | |
| $(".mbledhje > .status__title").style.color = "orange"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Grading test</title> | |
| <link rel="stylesheet" href="style.css" charset="utf-8"> | |
| <script src="test.js" charset="utf-8"></script> | |
| </head> | |
| <body> | |
| <div class="status mbledhje"> | |
| <h1 class="status__title">1. Mbledhje</h1> | |
| <div class="success"></div> | |
| <div class="failure"></div> | |
| </div> | |
| <script src="grading.js" charset="utf-8"></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html, body { | |
| padding: 1em 2em; | |
| } | |
| .status { | |
| display: block; | |
| padding-bottom: 1em; | |
| font-weight: bold; | |
| } | |
| .status__title { | |
| font-size: 1.8em; | |
| } | |
| .status .success { | |
| color: green; | |
| } | |
| .status .failure { | |
| color: red; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Implemento funksionin e meposhtem. | |
| * | |
| * @param a Mbledhori i pare | |
| * @param b Mbledhori i dyte | |
| * @return Shuma e a dhe b | |
| */ | |
| function mblidh(a, b) { | |
| if (b < 0) return -1; | |
| return a + b; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment