Skip to content

Commit

Permalink
Answer submisson form added and showing stored answers
Browse files Browse the repository at this point in the history
  • Loading branch information
sachin10101998 committed Jul 23, 2019
1 parent 19134c6 commit fb51c8c
Show file tree
Hide file tree
Showing 1,910 changed files with 94,602 additions and 24,169 deletions.
10 changes: 5 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
#
# Use of `relative_permalinks` ensures post links from the index work properly.
permalink: pretty


# Setup
title: Artificial Intelligence
tagline: 'AIMA Exercises '
description: 'AIMA Exercises: Exercises for the book Artificial Intelligence: A Modern Approach'
url: https://aimacode.github.io/aima-exercises/
baseurl: '/aima-exercises'
incremental: true


# About/contact
author:
name: Sachin Chopra
url: sachin10101998.github.io
email: [email protected]

# Custom vars
version: 1.0.0
plugins:
- jekyll-paginate
paginate: 5
#Staticman
staticman:
repository : aimacode/aima-exercises # GitHub username/repository eg. "daattali/beautiful-jekyll"
branch : "master"

18 changes: 0 additions & 18 deletions _includes/answers.html

This file was deleted.

31 changes: 0 additions & 31 deletions _includes/breadcrumb.html

This file was deleted.

3 changes: 1 addition & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
<link rel="stylesheet" href="{{ site.baseurl }}/public/css/syntax.css">
<link rel="stylesheet" href="{{ site.baseurl }}/public/css/lanyon.css">
<link rel="stylesheet" href="{{ site.baseurl }}/public/css/style.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">



<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}/public/apple-touch-icon-precomposed.png">
<link rel="shortcut icon" href="{{ site.baseurl }}/public/aima_logo.ico">
Expand Down
36 changes: 36 additions & 0 deletions _includes/staticman-comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<br><br>
<div id="writeeanswer"></div>
<div class="styling" id="styling2">
<form class="contact100-form validate-form" id="new_comment" method="post" action="{{ site.staticman.endpoint | default: 'https://staticmanlove.herokuapp.com/v3/entry/github/sachin10101998bot/aima-exercises/master' }}/{{ page.canonical_id }}">
<span class="contact100-form-title">
<center>Submit Solution</center>
</span>
<br>
<div class="wrap-input100 rs1-wrap-input100 validate-input" data-validate="Name is required" >
<span class="label-input100">Your Display Name</span>
<input class="input100" type="text" placeholder="Enter your Display name" name="fields[Name]" tabindex="3">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 rs1-wrap-input100 validate-input" data-validate = "Valid email is required: [email protected]">
<span class="label-input100">Email</span>
<input class="input100" type="text" placeholder="Enter your email addess" name="fields[Email]" tabindex="2">
<span class="focus-input100"></span>
</div>
<div class="wrap-input100 validate-input" data-validate = "Message is required">
<span class="label-input100">Solution</span>
<textarea class="input100" placeholder="Your solution here..." name="fields[message]" tabindex="1"></textarea>
<span class="focus-input100"></span>
</div>
<input type="hidden" name="options[redirect]" value="https://aimacode.github.io/aima-exercises/answersubmitted/">

<div class="container-contact100-form-btn">

<button class="contact100-form-btn" tabindex="5">
<span>
Submit
<i class="fa fa-long-arrow-right m-l-7" aria-hidden="true"></i></center>
</span>
</button>
</div>
</form>
</div>
13 changes: 0 additions & 13 deletions _includes/svg-icons.html

This file was deleted.

2 changes: 1 addition & 1 deletion _layouts/answersubmitted.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

{{ content }}
</div>
</article>
</article>
7 changes: 0 additions & 7 deletions _layouts/chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
<div class="entry">
{{ content }}
</div>

<!-- <div class="date">
Written on {{ page.date | date: "%B %e, %Y" }}
</div>
-->

</article>

<script type="text/javascript">
var chapter = String('{{ page.permalink }}')
var chapterName = chapter.match(/\/([^\/]*)\//, "")[1]
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h3 class="masthead-title">
<script src="{{ site.baseurl }}/js/answer.js"></script>

<script src="{{ site.baseurl }}/js/commsol.js"></script>

<script src="{{ site.baseurl }}/js/forms.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions _layouts/default2.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ <h3 class="masthead-title">
})(document);
</script>
<script src="{{ site.baseurl }}/js/main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

</body>
</html>
3 changes: 2 additions & 1 deletion _layouts/default3.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en-us">
{% include head.html %}
<body class="theme-base-08">
<body >
{% include sidebar.html %}
<div class="wrap">
<div class="masthead">
Expand Down Expand Up @@ -40,6 +40,7 @@ <h3 class="masthead-title">
})(document);
</script>
<script src="{{ site.baseurl }}/js/main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

</body>
</html>
47 changes: 47 additions & 0 deletions _layouts/default4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en-us">
{% include head.html %}
<body>
{% include sidebar2.html %}
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="{{ site.baseurl }}/" title="Home">{{ site.title }}</a>
<small>{{ site.tagline }}</small>
</h3>
<br>
<center>
<form class="form-inline active-pink-3 active-pink-4">
<i class="fas fa-search" aria-hidden="true"></i>
<input class="form-control form-control-sm ml-3 w-75" type="text" placeholder="Search within AIMA Exercises" aria-label="Search" name="query">
</form>
<br>
</center>
</div>
</div>
<div class="container content">
{{ content }}
</div>
<label for="sidebar-checkbox" class="sidebar-toggle"></label>
<script>
(function(document) {
var toggle = document.querySelector('.sidebar-toggle');
var sidebar = document.querySelector('#sidebar');
var checkbox = document.querySelector('#sidebar-checkbox');
document.addEventListener('click', function(e) {
var target = e.target;
if(!checkbox.checked ||
sidebar.contains(target) ||
(target === checkbox || target === toggle)) return;
checkbox.checked = false;
}, false);
})(document);
</script>
<script src="{{ site.baseurl }}/js/main.js"></script>
<script src="{{ site.baseurl }}/js/answer.js"></script>
<script src="{{ site.baseurl }}/js/exercise.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</body>
</html>
27 changes: 13 additions & 14 deletions _layouts/exercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<a href='#' class="p-2">{{ page.title }}</a>
<a class="solve_question" id="solve_question" href="#">
<button type="button" class="btn btn-dark float-right" title="Solve this Exercise" href="#" id="buttonsolve">
<i id="{{ page.breadcrumb5 }}" class="fas fa-pen" style="color:white"></i>
<i id="{{ page.canonical_id }}" class="fas fa-pen" style="color:white"></i>
</button>
</a>
<a class="edit_question" id="editt_question" href="#">
<button type="button" class="btn btn-dark float-right" title="Edit this Question" style="margin-left:10px; margin-right:10px;" onclick="edit('{{ page.breadcrumb5 }}');" href="#" id="buttonsolve">
<i id="{{ page.breadcrumb5 }}" class="far fa-edit" style="color:white"></i>
<button type="button" class="btn btn-dark float-right" title="Edit this Question" style="margin-left:10px; margin-right:10px;" onclick="edit('{{ page.canonical_id }}');" href="#" id="buttonsolve">
<i id="{{ page.canonical_id }}" class="far fa-edit" style="color:white"></i>
</button>
</a>
</div>
Expand All @@ -35,7 +35,7 @@
<i class="fas fa-hands" style="color:white"></i>
</button>
</a>
<a class="viewcommsolution" id="viewcommsolution" href="#">
<a class="viewcommsolution" id="viewcommsolution">
<button type="button" class="btn btn-dark float-right" title="View Community solution" style="margin-left:10px; margin-right:10px;" onclick="myFunction2()" href="#" id="viewsol">
<i class="fas fa-bars" style="color:white"></i>
</button>
Expand All @@ -58,7 +58,7 @@
</button>
</a>

<a class="viewusersolution" id="viewusersolution" href="#">
<a class="viewusersolution" id="viewusersolution">
<button type="button" class="btn btn-dark float-right" title="View Answers" style="margin-left:10px; margin-right:10px;" id="viewanswers" onclick="myFunction4()" href="#" >
<i class="fas fa-bars" style="color:white"></i>
</button>
Expand All @@ -71,20 +71,19 @@
</div>
</div>
</div>
{% include comments.html %}
{% include staticman-comments.html %}
</article>
<script>
var baseurl="https://github.com/sachin10101998/gsoc-aima-exercises/edit/master/markdown/";

var baseurl="https://github.com/aimacode/aima-exercises/edit/master/markdown/";
var chapterName = String('{{ page.breadcrumb }}');
var fullName = String('{{ page.canonical_id }}');
var dot = fullName.indexOf(".");
var dot2 = fullName.indexOf("x");
var dot = fullName.indexOf("x");
var exerciseName = "ex_";
var subs = fullName.substring(dot+1,fullName.length);
exerciseName+=subs;
document.getElementById("editt_question").href = baseurl+chapterName+"/exercises/"+exerciseName+"/question.md";
document.getElementById("solve_question").href = baseurl+chapterName+"/exercises/"+exerciseName+"/answers/useranswers.yaml";
document.getElementById("addanswerorcomment").href= baseurl+chapterName+"/exercises/"+exerciseName+"/answers"+"useranswers.yaml";
document.getElementById("link").innerHTML = "https://api.github.com/repos/sachin10101998/aima-exercises/contents/markdown/"+chapterName+"/exercises/"+exerciseName+"/answers";
</script>
document.getElementById("solve_question").href = "#writeeanswer";
document.getElementById("addanswerorcomment").href= "#writeeanswer";
document.getElementById("link").innerHTML = "https://api.github.com/repos/aimacode/aima-exercises/contents/markdown/"+chapterName+"/exercises/"+exerciseName+"/answers";
document.getElementById("link2").innerHTML = "https://api.github.com/repos/aimacode/aima-exercises/contents/markdown/"+chapterName+"/exercises/"+exerciseName+"/answers";
</script>
13 changes: 9 additions & 4 deletions _site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
<link rel="stylesheet" href="/aima-exercises/public/css/syntax.css">
<link rel="stylesheet" href="/aima-exercises/public/css/lanyon.css">
<link rel="stylesheet" href="/aima-exercises/public/css/style.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">



<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/aima-exercises/public/apple-touch-icon-precomposed.png">
<link rel="shortcut icon" href="/aima-exercises/public/aima_logo.ico">
Expand All @@ -36,7 +35,7 @@
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
</head>

<body class="theme-base-08">
<body>
<!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular
styles, `#sidebar-checkbox` for behavior. -->
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">
Expand Down Expand Up @@ -137,6 +136,12 @@ <h1 class="page-title">404: Page not found</h1>
}, false);
})(document);
</script>
<script src="/aima-exercises/main.js"></script>
<script src="/aima-exercises/js/main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/aima-exercises/js/answer.js"></script>

<script src="/aima-exercises/js/commsol.js"></script>
<script src="/aima-exercises/js/forms.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</body>
</html>
Loading

0 comments on commit fb51c8c

Please sign in to comment.