├── images ├── logo.png ├── give_star.png ├── load_unpacked.png ├── developer_mode.png ├── extension_icon.png └── installed_extension.png ├── background.js ├── manifest.json ├── popup.html ├── contentScript.js ├── styles.css ├── Readme.md └── script.js /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/logo.png -------------------------------------------------------------------------------- /images/give_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/give_star.png -------------------------------------------------------------------------------- /images/load_unpacked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/load_unpacked.png -------------------------------------------------------------------------------- /images/developer_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/developer_mode.png -------------------------------------------------------------------------------- /images/extension_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/extension_icon.png -------------------------------------------------------------------------------- /images/installed_extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/HEAD/images/installed_extension.png -------------------------------------------------------------------------------- /background.js: -------------------------------------------------------------------------------- 1 | chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) // Listen request 2 | { 3 | if (request.submit) // if submit is pressed 4 | { 5 | chrome.tabs.query({active: true, currentWindow: true}, function (tabs) 6 | { 7 | chrome.tabs.sendMessage(tabs[0].id, {message: "Start Evaluate"}); // send the message to content.js 8 | }); 9 | } 10 | }); -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "name": "IUT Course Evaluation Helper", 4 | "description": "It is designed to help IUT students quickly complete their course evaluations each semester.", 5 | "version": "1.0", 6 | "action": 7 | { 8 | "default_popup": "popup.html", 9 | 10 | "default_icon": "images/logo.png" 11 | }, 12 | "content_scripts": [ 13 | { 14 | "matches": ["https://sis.iutoic-dhaka.edu/evaluate-course/*"], 15 | "js": ["contentScript.js"], 16 | "run_at": "document_start" 17 | } 18 | ], 19 | "host_permissions": [""], 20 | "background": { 21 | "service_worker": "background.js" 22 | }, 23 | "permissions": ["storage", "activeTab", "scripting"] 24 | } 25 | -------------------------------------------------------------------------------- /popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Evaluate SIS 6 | 7 | 8 | 9 |
10 |

Evaluate Course

11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 |
28 | 29 | 30 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /contentScript.js: -------------------------------------------------------------------------------- 1 | const fillTheTextBoxes = function () { 2 | chrome.storage.local.get('Feedback', function (result) { 3 | let feedback = result.Feedback; 4 | if (feedback === undefined || feedback === null || feedback === "") { 5 | feedback = "N/A"; 6 | } 7 | var textareas = document.getElementsByClassName('form-control'); 8 | for (let i = 0; i < textareas.length; i++) { 9 | textareas[i].value = feedback; 10 | 11 | // trigger the user interaction true 12 | textareas[i].dispatchEvent(new Event('input', { bubbles: true })); 13 | textareas[i].dispatchEvent(new Event('change', { bubbles: true })); 14 | } 15 | }); 16 | 17 | } 18 | 19 | const checkTheRadios = function () { 20 | chrome.storage.local.get('Rating', function (result) { 21 | let rating = result.Rating; 22 | let nthCheckBox = document.querySelectorAll(`input[type="radio"][value="${rating}"]`); 23 | 24 | for (let i = 0; i < nthCheckBox.length; i++) { 25 | nthCheckBox[i].click(); 26 | } 27 | }) 28 | }; 29 | 30 | 31 | 32 | const evaluate = function () { 33 | fillTheTextBoxes(); 34 | checkTheRadios(); 35 | }; 36 | 37 | 38 | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) 39 | { 40 | // console.log("Content script received a message:", request); 41 | if (request.message == "Start Evaluate") { 42 | evaluate(); 43 | } 44 | }); -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | color: #fff; 4 | } 5 | 6 | .container { 7 | max-width: 400px; 8 | margin: 0 auto; 9 | padding: 20px; 10 | } 11 | 12 | p { 13 | font-size: 20px; 14 | font-weight: bold; 15 | } 16 | 17 | .Title { 18 | margin-top: 0; 19 | } 20 | 21 | form { 22 | margin-top: 20px; 23 | } 24 | 25 | .radio-group { 26 | display: flex; 27 | align-items: center; 28 | } 29 | 30 | input[type="radio"] { 31 | display: none; 32 | } 33 | 34 | input[type="radio"]+label { 35 | display: inline-block; 36 | width: 30px; 37 | height: 30px; 38 | line-height: 30px; 39 | text-align: center; 40 | border: 2px solid #fff; 41 | border-radius: 50%; 42 | margin-right: 10px; 43 | cursor: pointer; 44 | } 45 | 46 | input[type="radio"]:hover+label { 47 | background-color: #585858; 48 | color: white; 49 | transition: 0.3s ease; 50 | } 51 | 52 | input[type="radio"]:checked+label { 53 | background-color: #fff; 54 | color: #000; 55 | } 56 | 57 | input[type="submit"], button[type="button"] { 58 | margin-top: 20px; 59 | padding: 10px 20px; 60 | background-color: #fff; 61 | color: #000; 62 | border: none; 63 | cursor: pointer; 64 | font-size: 16px; 65 | border-radius: 5px; 66 | transition: background-color 0.3s ease; 67 | } 68 | 69 | input[type="submit"]:hover, button[type="button"]:hover { 70 | background-color: #555; 71 | color: #fff; 72 | } 73 | 74 | input[type="submit"]:active, button[type="button"]:active { 75 | background-color: #222222; 76 | } 77 | 78 | .textbox-container { 79 | margin-top: 20px; 80 | } 81 | 82 | .textbox-container input[type="text"] { 83 | width: 100%; 84 | padding: 10px; 85 | box-sizing: border-box; 86 | } -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # IUT Course Evaluation Helper Extension 2 | 3 | This browser extension is designed to help IUT students quickly complete their course evaluations each semester. It will only work on [IUT-SIS](https://sis.iutoic-dhaka.edu) for evaluating the courses. 4 | 5 | ## Introduction 6 | 7 | For **IUT students**, evaluating each course every semester involves answering around 36 questions: 9 are text boxes, and 27 are radio buttons where students rate from 1 to 5 stars. This process is very time-consuming, especially with 10 or more courses to evaluate. 8 | 9 | This extension is created to save time. With one click, all questions will be filled with your provided values. 10 | 11 | ## Download and Installation Guide 12 | 13 | This is a browser extension for Chrome and other Chromium-based browsers like Microsoft Edge. 14 | 15 | 1. **Download the Extension** 16 | - Click on [this link](https://github.com/notAvailable73/IUT-Course-Evaluation-Helper-Extension/archive/refs/heads/main.zip) to download the extension files. 17 | - Extract the downloaded file. 18 | 19 | 2. **Install the Extension** 20 | - Open your Chrome or Edge browser. 21 | - Go to the Extensions page by clicking on the three dots at the top right corner, then selecting `Extensions` > `Manage Extensions`. 22 | - Turn on **Developer mode**. You can find the switch at the top right of the Extensions page. 23 | - ![Developer mode](images/developer_mode.png) 24 | - Click on the `Load unpacked` button. 25 | - ![Load unpacked button](images/load_unpacked.png) 26 | - Select the folder where you downloaded and extracted the extension files. 27 | - The extension will be installed, and you will see it in the list of extensions. Pin it to use it comfortably. 28 | - ![Installed extension](images/installed_extension.png) 29 | 30 | ## How to Use the Extension 31 | 32 | - The extension icon will appear next to the address bar in your browser. 33 | - ![Extension icon](images/extension_icon.png) 34 | - Go to [SIS-Evaluation](https://sis.iutoic-dhaka.edu/evaluation-list) to evaluate any course. Select any course that has not been evaluated. 35 | - If the page was already visited before installation, please reload the page. 36 | - Click on the extension icon next to the address bar. 37 | - Provide your input values and then click submit. 38 | ## Like the project? 39 | - Don't forget us from your Du'a! 🤲 40 | - If you like the project, please consider giving it a star ⭐️ 41 | - ![Give Star](images/give_star.png) 42 | 43 | ## Troubleshooting 44 | 45 | - If you don't see the extension icon, make sure it's enabled. 46 | - If you face any issues, try reloading the extension by turning Developer mode off and on again, then click `Load unpacked` and select the folder again. 47 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | 2 | const initialize = function () { // Load previous values 3 | chrome.storage.local.get(['Rating', 'Feedback'], function (result) { 4 | 5 | let rating = result.Rating; 6 | if (rating === undefined || rating === null || rating === "") { // Default vallue assign for first installation 7 | rating = "5"; 8 | } 9 | let nthCheckBox = document.querySelector(`input[name="rating"][value="${rating}"]`); 10 | nthCheckBox.click(); 11 | 12 | 13 | let feedback = result.Feedback; 14 | if (feedback === undefined || feedback === null || feedback === "") { // Default vallue assign for first installation 15 | feedback = "N/A"; 16 | } 17 | var textarea = document.getElementById('feedback'); 18 | textarea.value = feedback; 19 | }) 20 | } 21 | 22 | initialize(); 23 | 24 | 25 | document.getElementById('ratingForm').addEventListener('submit', function (event) { // if submit button is pressed 26 | event.preventDefault(); 27 | 28 | var rating = document.querySelector('input[name="rating"]:checked').value; 29 | chrome.storage.local.set({ 'Rating': rating }); //save the value in local storage 30 | 31 | 32 | var feedback = document.getElementById('feedback').value; 33 | chrome.storage.local.set({ 'Feedback': feedback }); //save the value in local storage 34 | 35 | 36 | chrome.runtime.sendMessage({ submit: true }); // send message to background.js when submit is pressed 37 | 38 | }); 39 | 40 | 41 | document.getElementById('submitAllBtn').addEventListener('click', function (event) { // if submit all button is pressed 42 | event.preventDefault(); 43 | const courseLinks = document.querySelectorAll(".course-action > a"); 44 | if (courseLinks.length === 0) { 45 | alert("No course evaluation links found on this page. go to'https://sis.iutoic-dhaka.edu/evaluation-list'"); 46 | return; 47 | } 48 | 49 | const basePayload = { 50 | "course_allocation_detail_id": "", 51 | "answers": [ 52 | { "question_id": 1, "value": 5 }, 53 | { "question_id": 2, "value": 5 }, 54 | { "question_id": 3, "value": 5 }, 55 | { "question_id": 4, "value": 5 }, 56 | { "question_id": 5, "value": "N/A" }, 57 | { "question_id": 6, "value": 5 }, 58 | { "question_id": 7, "value": "N/A" }, 59 | { "question_id": 8, "value": 5 }, 60 | { "question_id": 9, "value": 5 }, 61 | { "question_id": 10, "value": 5 }, 62 | { "question_id": 11, "value": 5 }, 63 | { "question_id": 12, "value": 5 }, 64 | { "question_id": 13, "value": "N/A" }, 65 | { "question_id": 14, "value": 5 }, 66 | { "question_id": 15, "value": 5 }, 67 | { "question_id": 16, "value": 5 }, 68 | { "question_id": 17, "value": 5 }, 69 | { "question_id": 18, "value": "N/A" }, 70 | { "question_id": 19, "value": 5 }, 71 | { "question_id": 20, "value": 5 }, 72 | { "question_id": 21, "value": 5 }, 73 | { "question_id": 22, "value": 5 }, 74 | { "question_id": 23, "value": "N/A" }, 75 | { "question_id": 24, "value": 5 }, 76 | { "question_id": 25, "value": 5 }, 77 | { "question_id": 26, "value": 5 }, 78 | { "question_id": 27, "value": "N/A" }, 79 | { "question_id": 28, "value": 5 }, 80 | { "question_id": 29, "value": 5 }, 81 | { "question_id": 30, "value": 5 }, 82 | { "question_id": 31, "value": 5 }, 83 | { "question_id": 32, "value": 5 }, 84 | { "question_id": 33, "value": 5 }, 85 | { "question_id": 34, "value": "N/A" }, 86 | { "question_id": 35, "value": "N/A" }, 87 | { "question_id": 36, "value": "N/A" } 88 | ] 89 | }; 90 | function getCookie(name) { 91 | return document.cookie.split("; ").find(row => row.startsWith(name + "="))?.split("=")[1]; 92 | } 93 | 94 | const xsrfToken = getCookie("XSRF-TOKEN"); 95 | const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content; 96 | 97 | courseLinks.forEach(async (a) => { 98 | const parts = a.href.split("/"); 99 | const id = parts.pop() || parts.pop(); // handles trailing slash 100 | console.log(a.href); 101 | 102 | const payload = { 103 | ...basePayload, 104 | course_allocation_detail_id: id 105 | }; 106 | 107 | fetch("https://sis.iutoic-dhaka.edu/api/course-evaluate", { 108 | method: "POST", 109 | credentials: "include", 110 | headers: { 111 | "Accept": "application/json, text/plain, */*", 112 | "Content-Type": "application/json", 113 | "X-CSRF-TOKEN": csrfToken, 114 | "X-XSRF-TOKEN": xsrfToken, 115 | "X-Requested-With": "XMLHttpRequest", 116 | "Sec-Fetch-Dest": "empty", 117 | "Sec-Fetch-Mode": "cors", 118 | "Sec-Fetch-Site": "same-origin", 119 | "Sec-GPC": "1" 120 | }, 121 | body: JSON.stringify(payload) 122 | }) 123 | .then(r => r.json().catch(() => r.text())) 124 | .then(data => console.log("Response:", data)) 125 | .catch(err => console.error("Error:", err)); 126 | 127 | }) 128 | chrome.runtime.sendMessage({ submitAll: true }); // send message to background.js when submit all is pressed 129 | }); 130 | --------------------------------------------------------------------------------