Skip to content
Open

ui #1

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
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\AccessArrange.js"
}
]
}
56 changes: 39 additions & 17 deletions AccessArrange.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ const courses = ['EOB', 'Insurance', 'Money Laundering', 'Economics']
const classes = [];
const assignedStudents = []
const numberOfClasses = 13;
let count = 0;

const createTable = () => {
count ++
let table = `
<tr>
<th scope="row">${count}</th>
<td></td>
<td></td>
<td></td>
</tr>`
$('#tbody').append(table)
}




// to generate random numbers
const random = (min, max) => {
Expand All @@ -16,20 +32,23 @@ const random = (min, max) => {


// create a list of students in order
const names = []
const names = ['Ade', 'piper', 'tobi', 'Oluwa', 'paul', 'ayo', 'ben', 'kola', 'adebayo', 'ayokunle',
'eto', 'ronald', 'christian', 'hakeem', 'ogechi', 'kaycee', 'pelumi', 'gold',' tola']

for(let i=1; i<100; i+=1) {
names.push(`Student--${i}`)
}


//for(let i=1; i<100; i+=1) {
// names.push(`Student--${i}`)
//}

// log(names)

const createGroups = () => {
const classifiedGroup = []
const arrayPool = [];
// create group of students
for(let i=1; i<=100; i+=1){
arrayPool.push({ group: random(9, 21), name: names[random(0, names["length"]-1)]})
for(let i=1; i<=19; i+=1){
arrayPool.push({ group: random(9, 21), name: names[random(0, names["length"])]})
}

// to create groups
Expand All @@ -40,15 +59,16 @@ const createGroups = () => {
// to know the number of students in a group and assign them
arrayPool.forEach((value) => {
classifiedGroup.forEach((test) => {
if(value["group"] == test["group"]){
test["frequency"]+=1
test["students"].push({nameOfStudent: value["name"], groupNumber: test["group"]})
while(test["students"].length > 5){
test["students"].pop()
test["frequency"]-=1
}
}
})
if (test.students.length > 5){
test.students.pop()
test.frequency -= 1
} else {
if (value.group === test.group) {
test.frequency += 1
test.students.push({nameOfStudent: value.name, groupNumber: test.group})
}
}
})
})
return { arrayPool, classifiedGroup }
}
Expand All @@ -61,16 +81,19 @@ const classifiedGroup = sample.classifiedGroup
const assignExamSchedule = (numberOfClasses) => {
let rearranged = ''
for (let i=1; i <= numberOfClasses; i+=1){
classes.push(random(0, courses["length"]-1))
classes.push(random(0, courses["length"]))
rearranged = classes.map((value, index) => {
return { group: index+9, course: courses[value] }
})
}
return rearranged
}


const arrangement = assignExamSchedule(numberOfClasses);



// =================== THIS IS THE GRID ARRANGEMENT PART =========== //

const assignExamClass = (array) => {
Expand Down Expand Up @@ -122,5 +145,4 @@ const assignSeats = (receivedArray) => {
})
return receivedArray
}

log(assignSeats(data))
27 changes: 27 additions & 0 deletions AccessJquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$(document).ready(function () {
$.support.cors = true;
var workbook = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
});

var excelIO = new GC.Spread.Excel.IO();

function ImportFile() {
var excelUrl = "./test.xlsx";

var oReq = new XMLHttpRequest();
oReq.open('get', excelUrl, true);
oReq.responseType = 'blob';
oReq.onload = function () {
var blob = oReq.response;
excelIO.open(blob, LoadSpread, function (message) {
console.log(message);
});
};
oReq.send(null);
}
function LoadSpread(json) {
jsonData = json;
workbook.fromJSON(json);

workbook.setActiveSheet("Revenues (Sales)");
}
26 changes: 26 additions & 0 deletions accessArrange.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* body{
background: ghostwhite;
display: grid;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin: 0;
padding: 2rem;
}

.box{
background: blue;
width: 10rem;
height: 10rem;
}

.container {
display: grid;
width: 80%;
height: 80%;
grid-template-rows: repeat(7, 1fr);
grid-template-columns: repeat(5, 1fr);
grid-gap: 10px;
align-items: center;

} */
Loading