diff --git a/assets/articles.js b/assets/articles.js index eab4902..8c00e92 100644 --- a/assets/articles.js +++ b/assets/articles.js @@ -1,80 +1,7 @@ if (localStorage.getItem("auth") == null) { localStorage.setItem("auth", "true"); } -var articleList = []; -var groups = [{ - 'name': 'Group 1', - 'id': 'group-1', - 'password': 'test1', - 'articles': [{ - 'title': 'Cold Nose Article', - 'filename': 'cold_nose_article' - }, - { - 'title': 'Exoplanet Article', - 'filename': 'exoplanet_article' - }, - { - 'title': 'Osmosis Article', - 'filename': 'osmosis_article' - } - ] - }, - { - 'name': 'Group 2', - 'id': 'group-2', - 'password': 'test2', - 'articles': [{ - 'title': 'Frogs Evaluation Article', - 'filename': 'frogs_evolution_article' - }, - { - 'title': 'Soils & Nutrient Cycle', - 'filename': 'table_readings_1' - }, - { - 'title': 'Earthworms Article', - 'filename': 'table_readings_2' - } - ] - }, { - 'name': 'Group 3', - 'id': 'group-3', - 'password': 'test3', - 'articles': [{ - 'title': 'Consume vs Consumed', - 'filename': 'table_readings_3' - }, - { - 'title': 'An Alive Bug?', - 'filename': 'table_readings_4' - }, - { - 'title': 'Nitrogen Cycle', - 'filename': 'table_readings_5' - } - ] - }, { - 'name': 'Group 4', - 'id': 'group-4', - 'password': 'test4', - 'articles': [{ - 'title': 'Carbon Cycle', - 'filename': 'table_readings_6' - }, - { - 'title': 'Recycling the Dead', - 'filename': 'table_readings_7' - }, - { - 'title': 'Gut Bacteria', - 'filename': 'table_readings_8' - } - ] - } -]; - -var articles = [{ +var articleLibrary = [{ 'title': 'Doctor with an eye for eyes', 'filename': 'doctor-with-an-eye-for-eyes' }, @@ -113,59 +40,112 @@ var articles = [{ { 'title': 'The Camping Trip', 'filename': 'the-camping-trip' + }, + { + 'title': 'Cold Nose Article', + 'filename': 'cold_nose_article', + 'from': new Date('2024-12-20T10:00:00'), + 'to': new Date('2024-12-20T16:30:00') + }, + { + 'title': 'Exoplanet Article', + 'filename': 'exoplanet_article', + 'from': new Date('2024-12-20T16:31:00'), + 'to': new Date('2024-12-21T16:30:00') + }, + { + 'title': 'Osmosis Article', + 'filename': 'osmosis_article', + 'from': new Date('2024-12-22T16:31:00'), + 'to': new Date('2024-12-23T16:30:00') + }, + { + 'title': 'Frogs Evaluation Article', + 'filename': 'frogs_evolution_article' + }, + { + 'title': 'Soils & Nutrient Cycle', + 'filename': 'table_readings_1' + }, + { + 'title': 'Earthworms Article', + 'filename': 'table_readings_2' + }, + { + 'title': 'Consume vs Consumed', + 'filename': 'table_readings_3' + }, + { + 'title': 'An Alive Bug?', + 'filename': 'table_readings_4' + }, + { + 'title': 'Nitrogen Cycle', + 'filename': 'table_readings_5' + }, + { + 'title': 'Carbon Cycle', + 'filename': 'table_readings_6' + }, + { + 'title': 'Recycling the Dead', + 'filename': 'table_readings_7' + }, + { + 'title': 'Gut Bacteria', + 'filename': 'table_readings_8' } ]; - -// var articles = [{ -// 'title': 'Cold Nose Article', -// 'filename': 'cold_nose_article' -// }, -// { -// 'title': 'Exoplanet Article', -// 'filename': 'exoplanet_article' -// }, -// { -// 'title': 'Osmosis Article', -// 'filename': 'osmosis_article' -// }, -// { -// 'title': 'Frogs Evaluation Article', -// 'filename': 'frogs_evolution_article' -// }, -// { -// 'title': 'Soils & Nutrient Cycle', -// 'filename': 'table_readings_1' -// }, -// { -// 'title': 'Earthworms Article', -// 'filename': 'table_readings_2' -// }, -// { -// 'title': 'Consume vs Consumed', -// 'filename': 'table_readings_3' -// }, -// { -// 'title': 'An Alive Bug?', -// 'filename': 'table_readings_4' -// }, -// { -// 'title': 'Nitrogen Cycle', -// 'filename': 'table_readings_5' -// }, -// { -// 'title': 'Carbon Cycle', -// 'filename': 'table_readings_6' -// }, -// { -// 'title': 'Recycling the Dead', -// 'filename': 'table_readings_7' -// }, -// { -// 'title': 'Gut Bacteria', -// 'filename': 'table_readings_8' -// } -// ]; - +var articleList = []; +var groups = [{ + 'name': 'Group 1', + 'id': 'group-1', + 'password': 'test1', + 'articles': [articleLibrary[10], articleLibrary[11], articleLibrary[12]] + }, + { + 'name': 'Group 2', + 'id': 'group-2', + 'password': 'test2', + 'articles': [articleLibrary[13], articleLibrary[14], articleLibrary[15]] + }, { + 'name': 'Group 3', + 'id': 'group-3', + 'password': 'test3', + 'articles': [articleLibrary[16], articleLibrary[17], articleLibrary[18]] + }, { + 'name': 'Group 4', + 'id': 'group-4', + 'password': 'test4', + 'articles': [articleLibrary[19], articleLibrary[20], articleLibrary[21]] + } +]; +var articles = [ + articleLibrary[0], + articleLibrary[1], + articleLibrary[2], + articleLibrary[3], + articleLibrary[4], + articleLibrary[5], + articleLibrary[6], + articleLibrary[7], + articleLibrary[8], + articleLibrary[9] +]; +var articlesPrev = [ + articleLibrary[10], + articleLibrary[11], + articleLibrary[12], + articleLibrary[13], + articleLibrary[14], + articleLibrary[15], + articleLibrary[16], + articleLibrary[17], + articleLibrary[18], + articleLibrary[19], + articleLibrary[20], + articleLibrary[21] +]; if (localStorage.getItem("auth") == "guest") { articleList = articles; } else { @@ -175,7 +155,6 @@ if (localStorage.getItem("auth") == "guest") { } }); } - if (localStorage.getItem("currentArticle") === null) { localStorage.setItem("currentArticle", articleList[0].filename); localStorage.setItem("currentArticleTitle", articleList[0].title); diff --git a/assets/main-working.js b/assets/main-working.js index 4dbad3e..e286e0d 100644 --- a/assets/main-working.js +++ b/assets/main-working.js @@ -1231,6 +1231,7 @@ ); }); $(".teacher-facing #article-menu p span").text(localStorage.getItem("currentArticleTitle")); + $(".student-robot-facing #article-menu p span").text(localStorage.getItem("currentArticleTitle")); $("#assignment-title").text(localStorage.getItem("currentArticleTitle")); window.pathArticleTitle = localStorage.getItem("currentArticleTitle"); $.each(emotionsList, function(i, v) { diff --git a/assets/session-recording.js b/assets/session-recording.js new file mode 100644 index 0000000..d1e5b99 --- /dev/null +++ b/assets/session-recording.js @@ -0,0 +1,123 @@ +var audioRecorders = new Map(); // Map to store recorder objects with IDs +var audioChunks = new Map(); // Map to store chunks for each ID +const today = new Date(); +var sessionRecordingData = { + 'title': formatAudioFileName(localStorage.getItem("currentArticleTitle")) + // will add the student usernames, password, related articles and deadlines here + // for now reusing the teacher side login info for the demo purposes +}; +sessionInit(); +$(document).on("click", "#start-assignment", function() { + startRecording(sessionRecordingData.title); +}); + +function sessionInit() { + $.each(articleList, function(i, v) { + $("#assignment-list").append( + "