diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..8cabd261e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,90 @@
+# Created by eadortsu
+### Node template
+# Logs
+/logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# Nuxt generate
+dist
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless
+
+# IDE / Editor
+.idea
+
+# Service worker
+sw.*
+
+# macOS
+.DS_Store
+
+# Vim swap files
+*.swp
diff --git a/README.md b/README.md
index e6fe98f19..a330b1ac4 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,22 @@
-# team-superman-hngi7
+# Team-superman-hngi7 (Superman's repo for HNGi7)
+
+# GUIDE LINES FOR WRITING YOUR SCRIPT:
+## 1. Do NOT embed your script inside any form of html
+
+## 2. Use simple logging functions.
+### For javaScript - console.log()
+### for python - print(),
+### for php - echo.
+
+## 3. Use this EXACT string format - "Hello World, this is [full name] with HNGi7 ID [ID] using [language] for stage 2 task". Do not add colon ( : ), Dash (-) or any other character.
+## 4. Replace everything inside the square brackets including the square brackets, with the correct values.
+
+## 5. I REPEAT DO NOT ADD ANY OTHER CHARACTER TO IT, JUST REPLACE THE APPROPRIATE VALUES.
+
+## 6. Save your file with a UNIQUE name. your username should be unique enough.
+
+# RESULTS SO FAR
+
+[Result page](https://ndubuisijr.github.io/superman-results)
+
+Your DESTINY is in your hands o...
diff --git a/composer.json b/composer.json
new file mode 100644
index 000000000..0e0dcd235
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,3 @@
+{
+
+}
\ No newline at end of file
diff --git a/index.php b/index.php
index 7921f4e48..ccc98360e 100644
--- a/index.php
+++ b/index.php
@@ -1,34 +1,126 @@
';
-
- unset($output);
- if(preg_match('/.php$/i', $file)){
- $output = exec('php scripts/'.$file);
- } elseif(preg_match('/.py$/i', $file)) {
- $output = exec('python scripts/'.$file);
- } elseif(preg_match('/.js$/i', $file)) {
- $output = exec('node scripts/'.$file);
+$files = array_filter(scandir('scripts'), function ($script) {
+ return !is_dir('scripts/' . $script);
+}); // To remove "." and ".." from the array output os scabdir
+
+$final = [];
+if ($files) {
+ foreach ($files as $file) {
+ $script = [];
+ $script['file'] = $file;
+ if (preg_match('/.php$/i', $file)) {
+ $output = exec('php -f scripts/' . $file .' 2>&1');
+ } elseif (preg_match('/.py$/i', $file)) {
+ $output = exec('python scripts/' . $file);
+ } elseif (preg_match('/.js$/i', $file)) {
+ $output = exec('node scripts/' . $file);
}
- if(isset($output)) {
- echo 'Output: '.$output.' ';
- $result = [];
- preg_match('/^Hello World, this is ([a-zA-Z -]*) with HNGi7 ID ((HNG-|)[0-9]{1,5}) using (Python|PHP|JavaScript|Node.js) for stage 2 task(.|)$/i', $output, $result);
- if(count($result) > 0) {
- echo 'Name: '.$result[1].' ';
- echo 'HNGi7 ID: '.$result[2].' ';
- echo 'Language: '.$result[4].' ';
- echo 'Result: Passed, congrats!!!';
+ if (isset($output)) {
+ $mainOutput=substr($output,0,strpos($output,"."));
+ $script['output'] = $mainOutput;
+ $result = [];
+ preg_match('/^Hello World, this is ([a-zA-Z -]*) with HNGi7 ID ((HNG-|)[0-9]{1,5}) using (Python|PHP|JavaScript|Node.js) for stage 2 task(.|)$/i', $mainOutput, $result);
+ if (count($result) > 0) {
+ $script['name'] = $result[1];
+ $script['id'] = $result[2];
+ $script['language'] = $result[4];
+ $script['status'] = 'Pass';
+ $script['email']=substr($output,strpos($output,".")+1);
} else {
- echo 'Result: Fail :(';
+ $script['name'] = "";
+ $script['id'] = "";
+ $script['language'] = "";
+ $script['status'] = 'Fail';
+ $script['email']='';
}
- } else {
- echo 'Result: Fail :(';
+
+ array_push($final, $script);
+
}
- echo ' ';
}
}
+if (!isset($_GET['json'])) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+ Team Superman- Task 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Scripts Results
+
+
+
+ Status
+ Output
+ File Name
+ Name
+ Language
+ ID
+
+
+
+
+
+ =$script['status']=='Pass'? 'Pass ': 'Fail ' ?>
+ =$script['output']?>
+ =$script['file']?>
+ =$script['name']?>
+ =$script['language']?>
+ =$script['id']?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+console.log("Hello World, this is Claire Munyole with HNGi7 ID HNG-00045 using JavaScript for stage 2 task");
diff --git a/scripts/EgboEmmanuel.js b/scripts/EgboEmmanuel.js
new file mode 100644
index 000000000..c5ec69c4e
--- /dev/null
+++ b/scripts/EgboEmmanuel.js
@@ -0,0 +1,7 @@
+function firstTask(fName, hId, lang) {
+ console.log(
+ `Nice Meeting you Here! This is ${fName} with HNGi7 ID of ${hId} using ${lang} for this stage task`
+ );
+ }
+ firstTask("Egbo Emmanuel", "HNG-04843", "Javascript");
+
\ No newline at end of file
diff --git a/scripts/Emmanuel.Eboh.html b/scripts/Emmanuel.Eboh.html
deleted file mode 100644
index 09629ad4c..000000000
--- a/scripts/Emmanuel.Eboh.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-Emmanuel.Eboh
-
-
\ No newline at end of file
diff --git a/scripts/EmmanuelUdoh.js b/scripts/EmmanuelUdoh.js
new file mode 100644
index 000000000..8f6d60257
--- /dev/null
+++ b/scripts/EmmanuelUdoh.js
@@ -0,0 +1,6 @@
+var info = function(fullname, id, language) {
+ return `Hello World, this is ${fullname} with HNGi7-ID ${id} using ${language} for stage 2 task`
+
+}
+let newInfo = info("Emmanuel Udoh", "HNG-02600", "Javascript");
+console.log(newInfo)
\ No newline at end of file
diff --git a/scripts/Emmanuel_Eboh.js b/scripts/Emmanuel_Eboh.js
new file mode 100644
index 000000000..cf10022fe
--- /dev/null
+++ b/scripts/Emmanuel_Eboh.js
@@ -0,0 +1,12 @@
+
+ const name = "Emmanuel Eboh";
+ const id = "HNG-01574";
+ const lang = "JavaScript";
+ console.log(
+ `Hello World, this is ${name} with ${id} using ${lang} for stage 2 task.`
+ );
+<<<<<<< HEAD:scripts/Emmanuel_Eboh.js
+=======
+
+