diff --git a/quiz/README.md b/quiz/README.md new file mode 100644 index 0000000..56a6b2f --- /dev/null +++ b/quiz/README.md @@ -0,0 +1,5 @@ +# Code for quiz feature + +This folder contains code for a multiple choice quiz feature implemented by *Marwan Announ*. +Sadly, this feature was not implemented in the main site due to lack of time. The code +is here just for grading purposes. diff --git a/quiz/ab_re_quiz.html b/quiz/ab_re_quiz.html new file mode 100644 index 0000000..f11e462 --- /dev/null +++ b/quiz/ab_re_quiz.html @@ -0,0 +1,121 @@ +--- +layout: page +category: File System +tags: absolute relative path +author: Marwan Announ +title: fs +--- +

+

ABSOLUTE VS RELATIVE

+ +

+ Now, you can ask, why I have to use one or another? +
What is the difference? and questions like this. +


Don't worry, the answer it's easy.., we can use an absolute path from any location +
whereas you want to use relative path we should be present that you have to be in the working directory. +

+ + +


We suppose that now you know the differences between both, but, what is the vantages and disadvantages? + + +


+

Pro and Cons of using Absolute and Relative

+ +
+
1)Absolute paths are clearer: who will have to maintain/modify your script (you or others) will be able to know +
every time what directories are involved; +

2)With absolute paths you are sure the involved directories are the one with the exact path you are writing +
in the script; +

3)Relative paths are shorter, but you need to be sure of the subtree you're working into; +

4)You can achieve shortness replacing recurring paths with a variable at the beginning of the script +

+(e.g. /var/log/app/component/module/logfile.log -> $module_log_dir/logfile.log) + + + + +
+ + + + +

I'm sure that if you read this for two or more times you will be able to pass the quiz

+ +Yeah, right, there is a quiz. +
The best way to learn something it's not the theory, in fact you have to do some practice, if you click +
the button "QUIZ", you can try to do a quiz in order to check what you've just read. + +


Don't worry it's for you, good luck + + +


* for css, please try to do a button or layout to links the quiz* + +

+ + + diff --git a/quiz/example_quiz_java/exampleofcss.css b/quiz/example_quiz_java/exampleofcss.css new file mode 100644 index 0000000..a063419 --- /dev/null +++ b/quiz/example_quiz_java/exampleofcss.css @@ -0,0 +1,74 @@ +body { + font-family: 'Lato', sans-serif; +} + + + +#quiz { + margin-left: 10px; + background: #d2def2; + padding: 10px 20px 10px 20px; + width: 400px; + border-radius: 20px; + float: left; + +} + +input { + margin-bottom: 20px; + display: block; +} + +#textbox { + height: 25px; + font-size: 16px; + border-radius: 5px; + border: none; + padding-left: 5px; +} + + +#button { + background: green; + border: none; + border-radius: 5px; + padding: 10px; + color: white; + font-size: 16px; + transition-duration: .5s; + margin-top: 15px; +} + + + +#button:hover { + background: white; + border: 1px solid green; + color: black; + cursor: pointer; + +} + +#after_submit { + visibility: hidden; + background: #ff5459; + padding: 10px 20px 10px 20px; + width: 400px; + border-radius: 20px; + float: left; + margin-left: 20px; + font-size: 30px; + + +} + +#picture { + width: 375px; + height: 245px; +} + + + +#mc { + display: inline; +} diff --git a/quiz/example_quiz_java/javasc.html b/quiz/example_quiz_java/javasc.html new file mode 100644 index 0000000..733df7d --- /dev/null +++ b/quiz/example_quiz_java/javasc.html @@ -0,0 +1,45 @@ + + + + + SA group-1 + + + + + + + + +

Are you ready for the quiz?

+ + +
+ + +

Which of the two groups are better?

+ + +

What is unix?

+ A dog
+ A type of..
+ +

What is absolute path?

+ + A type of..
+ A dog
+ + +

+ + +
+ +
+

+

+ +
+ + + diff --git a/quiz/example_quiz_java/main.js b/quiz/example_quiz_java/main.js new file mode 100644 index 0000000..01041a0 --- /dev/null +++ b/quiz/example_quiz_java/main.js @@ -0,0 +1,40 @@ +function check(){ + + var question1 = document.quiz.question1.value; + var question2 = document.quiz.question2.value; + var question3 = document.quiz.question3.value; + var correct = 0; + + + if (question1 == "group1") { + correct++; +} + if (question2 == "A type of..") { + correct++; +} + if (question3 == "A type of..") { + correct++; + } + + var pictures = ["img/win.gif", "img/meh.jpeg", "img/lose.gif"]; + var messages = ["Great job!", "That's just okay", "You really need to do better"]; + var score; + + if (correct == 0) { + score = 2; + } + + if (correct > 0 && correct < 3) { + score = 1; + } + + if (correct == 3) { + score = 0; + } + + document.getElementById("after_submit").style.visibility = "visible"; + + document.getElementById("message").innerHTML = messages[score]; + document.getElementById("number_correct").innerHTML = "You got " + correct + " correct."; + document.getElementById("picture").src = pictures[score]; + } diff --git a/quiz/java_ab_re.js b/quiz/java_ab_re.js new file mode 100644 index 0000000..d7ba9fb --- /dev/null +++ b/quiz/java_ab_re.js @@ -0,0 +1,51 @@ +function check(){ + + var question1 = document.quiz.question1.value; + var question2 = document.quiz.question2.value; + var question3 = document.quiz.question3.value; + var question4 = document.quiz.question4.value; + var question5 = document.quiz.question5.value; + + + var correct = 0; + + + if (question1 == "Is a location to a folder or file in a file system of a Operating System") { + correct++; +} + if (question2 == "Is defined as specifying the location of a file or directory from the root directory(/)") { + correct++; +} + if (question3 == "YES") { + correct++; + } + if (question4 == "") { + correct++; + } + if (question5 == "YES") { + correct++; + } + + + var pictures = ["img/win.gif", "img/meh.jpeg", "img/lose.gif"]; + var messages = ["Great job!", "That's just okay", "You really need to do better"]; + var score; + + if (correct == 0) { + score = 4; + } + + if (correct > 0 && correct < 5) { + score = 3; + } + + if (correct == 5) { + score = 0; + } + + document.getElementById("after_submit").style.visibility = "visible"; + + document.getElementById("message").innerHTML = messages[score]; + document.getElementById("number_correct").innerHTML = "You got " + correct + " correct."; + document.getElementById("picture").src = pictures[score]; + }