Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 4, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 challenges.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"Python Beginner Challenges","last_edit":1496278825778,"challenges":[[],[{"id":"592f1cc969cf862d8a7bb7f2","title":"Input Edit","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":1,"lesson":3}],[],[],[{"id":"592893767a194ee412ae2e1f","title":"Addition Edit","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":1},{"id":"592895b87a194ee412ae2e20","title":"Subtraction","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":2},{"id":"592895ef7a194ee412ae2e21","title":"Multiplication","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":3},{"id":"5928961e7a194ee412ae2e22","title":"Float Division","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":4},{"id":"592896397a194ee412ae2e23","title":"Integer Division","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":5},{"id":"5928965a7a194ee412ae2e24","title":"Exponents","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":6},{"id":"592896717a194ee412ae2e25","title":"Remainder","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":7},{"id":"592898c97a194ee412ae2e26","title":"Divmod","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":8},{"id":"592898dc7a194ee412ae2e27","title":"Square Root","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":9},{"id":"592899f67a194ee412ae2e28","title":"Sum","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":10},{"id":"59289a1a7a194ee412ae2e29","title":"Rounding","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":11},{"id":"59289a2f7a194ee412ae2e2a","title":"Absolute Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":12},{"id":"59289a477a194ee412ae2e2b","title":"Min Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":13},{"id":"59289a5a7a194ee412ae2e2c","title":"Max Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":14}],[]]}
{"name":"Python Beginner Challenges","last_edit":1496291556934,"chapters":["Introduction","Input","Dummy","Dummy 2","Math"],"challenges":[[],[],[],[],[{"id":"592893767a194ee412ae2e1f","title":"Addition","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":1},{"id":"592895b87a194ee412ae2e20","title":"Subtraction","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":2},{"id":"592895ef7a194ee412ae2e21","title":"Multiplication","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":3},{"id":"5928961e7a194ee412ae2e22","title":"Float Division","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":4},{"id":"592896397a194ee412ae2e23","title":"Integer Division","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":5},{"id":"5928965a7a194ee412ae2e24","title":"Exponents","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":6},{"id":"592896717a194ee412ae2e25","title":"Remainder","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":7},{"id":"592898c97a194ee412ae2e26","title":"Divmod","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":8},{"id":"592898dc7a194ee412ae2e27","title":"Square Root","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":9},{"id":"592899f67a194ee412ae2e28","title":"Sum","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":10},{"id":"59289a1a7a194ee412ae2e29","title":"Rounding","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":11},{"id":"59289a2f7a194ee412ae2e2a","title":"Absolute Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":12},{"id":"59289a477a194ee412ae2e2b","title":"Min Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":13},{"id":"59289a5a7a194ee412ae2e2c","title":"Max Value","repl":"https://repl.it/student_embed/assignment/136137/d860e0ad34862a709895f54706dcf9af","completed":false,"chapter":4,"lesson":14}],[]]}
2 changes: 1 addition & 1 deletion 2 challenges/4.1.Addition/lesson_settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lesson_title": "Addition Edit",
"lesson_title": "Addition",
"chapter_number": 4,
"lesson_number": 1,
"id":"592893767a194ee412ae2e1f",
Expand Down
18 changes: 18 additions & 0 deletions 18 generate-challenge-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,26 @@ dir_list.forEach((dir) => {
"lesson": lesson_number
};

// attempt to autofill 'missing' challenges
//
// const blank_lesson_obj = {
// "id": null,
// "title": "NA",
// "repl": default_repl,
// "completed": false,
// "chapter": null,
// "lesson": null
// }

if (!challenges_id_list.includes(id)) {
let chapter = challenges_list[chapter_number];
// if ( lesson_number !== 1 && chapter.length < lesson_number ) {
// for (let i = 1; i < lesson_number; i++ ) {
// blank_lesson_obj.chapter = chapter_number;
// blank_lesson_obj.lesson = i;
// chapter.push(blank_lesson_obj);
// }
// }
let a = chapter.slice(0, lesson_number);
let b = chapter.slice(lesson_number + 1, chapter.length);
a.push(lesson_obj);
Expand Down
7 changes: 1 addition & 6 deletions 7 index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,10 @@

<div id="map" class="map">
<a href="javascript:void(0)" class="close-map" onclick="toggleMap()">&times;</a>
<div class="challenge-list">
<a href="#" onclick="loadChallengeFromMap('a')">Addition</a>
<a href="#" onclick="loadChallengeFromMap('b')">Subtraction</a>
<a href="#" onclick="loadChallengeFromMap('c')">Dummy 1</a>
<a href="#" onclick="loadChallengeFromMap('d')">Dummy 2</a>
</div>
</div>

<script src="load-challenges.js"></script>
<script src="renderMap.js"></script>
<script src="map.js"></script>
</body>
</html>
58 changes: 58 additions & 0 deletions 58 renderMap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*global $*/
function createLesson(title, id) {
const linkNode = document.createElement("a");
linkNode.classList.add("lesson-link");
linkNode.appendChild(document.createTextNode(title));
linkNode.setAttribute("href", "");
linkNode.setAttribute("onclick", `loadChallengeFromMap('${id}')`);
const listNode = document.createElement("li");
listNode.classList.add("lesson-list-element");

listNode.appendChild(linkNode);

return listNode;
}
function createChapter(title, lessonList) {
const chapterNode = document.createElement("div");
chapterNode.classList.add("chapter");

const titleSpanNode = document.createElement("span");
titleSpanNode.classList.add("chapter-title");
titleSpanNode.appendChild(document.createTextNode(title));

chapterNode.appendChild(titleSpanNode);

const lessonListNode = document.createElement("ul");
lessonListNode.classList.add("lesson-list");

lessonList.forEach((lesson) => {
lessonListNode.appendChild(createLesson(lesson.title, lesson.id));
});

chapterNode.appendChild(lessonListNode);

return chapterNode;
}
function renderMap() {
const map = document.getElementById("map");

const challengeList = document.createElement("div");
challengeList.classList.add("challenge-list");


$.getJSON("./challenges.json")
.done(({chapters, challenges}) => {
challenges.forEach((lessons, i) => {
const title = chapters[i];
challengeList.appendChild(createChapter(title, lessons));
});
})
.fail((jqxhr, textStatus, error ) => {
console.log(`Req failed: ${textStatus}, ${error}`);
});

map.appendChild(challengeList);

}

renderMap();
18 changes: 18 additions & 0 deletions 18 stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,21 @@ h2 {
.challenge-list {
border-top: 2px solid #006400;
}

.chapter {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
}
.chapter-title {
color: #006400;
font-size: 1.5rem;
padding-left: 10px;
}
.lesson-list {
list-style: none;
align-self: left;
padding-left: 5px;
margin-top: 0;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.