-
Notifications
You must be signed in to change notification settings - Fork 2
/
Assignments.html
110 lines (98 loc) · 3.36 KB
/
Assignments.html
1
2
3
4
5
6
7
8
9
10
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Masai | Assignment Add</title>
<link rel="stylesheet" href="style/adminNavbar.css">
<style>
#container {
width: 80%;
margin: auto;
margin-top: 50px;
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
padding: 20px;
border-radius: 10px;
}
#container>div {
box-shadow: rgba(17, 17, 26, 0.1) 0px 1px 0px;
padding: 20px;
line-height: 30px;
display: flex;
justify-content: space-between;
align-items: center;
}
#container>div button{
padding:5px 20px;
border-radius: 5px;
border: 1px solid #7b46e6;
color: #7b46e6;
}
#container>div button:hover{
color: red;
cursor: pointer;
}
p {
font-size: 12px;
}
</style>
</head>
<body onload="append(assign)">
<div id="navbar">
<div id="navbar_div">
<img id="logo" src="https://www.masaischool.com/img/navbar/logo.svg" onclick="window.location.href='admin.html'">
<div onclick="window.location.href='lecture.html'">Lectures</div>
<div onclick="window.location.href='Assignments.html'">Assignments</div>
<div>Quizzes</div>
<div>Tickets</div>
<div>Discussions</div>
<div>Notifications</div>
<div>Electives</div>
</div>
<div id="navbar_div2">
<div id="name"></div>
<button id="logout" onclick="window.location.href='login.html'">LOG OUT</button>
</div>
</div>
<div id="sub_navbar">
<div>Assignments</div>
<div>
<button id="create" onclick="window.location.href='create.html'">Create Assignments</button>
</div>
</div>
<div id="container"></div>
</body>
</html>
<script src="script/adminNavbar.js"></script>
<script>
let assign=JSON.parse(localStorage.getItem("assignment"))||[];
append = (assign) => {
let container = document.getElementById("container");
container.innerHTML = null;
assign.forEach((el,i) => {
let head = document.createElement("h2");
head.innerText = `${el.subject} ${el.date}`;
head.style.color = "#7b46e6";
let base = document.createElement("p");
base.innerText = `${el.instructorname} Created Assignment Problem's at ${el.date}-${el.time}`
let remove = document.createElement("button");
remove.innerText = "Remove";
remove.addEventListener("click", function () {
deletes(i);
})
let div1s = document.createElement("div");
div1s.append(remove)
let divs = document.createElement("div");
divs.append(head, base);
let div2s = document.createElement("div");
div2s.append(divs,div1s)
container.append(div2s);
})
}
deletes=(i)=>{
assign.splice(i,1);
localStorage.setItem("assignment",JSON.stringify(assign))
window.location.reload();
}
</script>