-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to the latest Digital Business class work
- Loading branch information
Showing
3 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Absolute Sigma - saku</title> | ||
|
||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<h1>โปรแกรมหาค่าเฉลี่ยเกรด</h1> | ||
|
||
<div class="bbox"> | ||
<button class="buttonx" id="bst" onclick="start_1()">กรอกคะแนน</button> | ||
</div> | ||
<br> | ||
|
||
<div class="textshowxbar"> | ||
<h2 id="showxbar" style="display: none"></h2> | ||
</div> | ||
|
||
<section class="head1"> | ||
<div class="box1"> | ||
<h3 id="cir">วิชาวงจรไฟฟ้าและการวัด</h3> | ||
<p class="score" id="show_score_cir"></p> | ||
<p class="score1" id="show_score_cir1"></p> | ||
</div> | ||
|
||
<div class="box2"> | ||
<h3 id="tec">วิชาเทคโนโลยีคอมพิวเตอร์</h3> | ||
<p class="score" id="show_score_tec"></p> | ||
<p class="score1" id="show_score_tec1"></p> | ||
</div> | ||
</section> | ||
|
||
<section class="head2"> | ||
<div class="box3"> | ||
<h3 id="pp">วิชาวงจรพัลส์และดิจิทัล</h3> | ||
<p class="score" id="show_score_pp"></p> | ||
<p class="score1" id="show_score_pp1"></p> | ||
</div> | ||
|
||
<div class="box4"> | ||
<h3 id="edu">วิชาเทคนิคการสอนและการจัดการเรียนรู้</h3> | ||
<p class="score" id="show_score_edu"></p> | ||
<p class="score1" id="show_score_edu1"></p> | ||
</div> | ||
</section> | ||
|
||
<div class="bbox"> | ||
<button class="buttonx2" id="bst1" style="display: none;" onclick="start_1()"> | ||
กรอกคะแนนอีกครั้ง | ||
</button> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
function start_1() { | ||
let number1 = prompt("กรุณาใส่คะแนนวิชาวงจรไฟฟ้าและการวัด : "); | ||
let number2 = prompt("กรุณาใส่คะแนนวิชาเทคโนโลยีคอมพิวเตอร์ : "); | ||
let number3 = prompt("กรุณาใส่คะแนนวิชาวงจรพัลส์และดิจิทัล : "); | ||
let number4 = prompt("กรุณาใส่คะแนนวิชาเทคนิคการสอนและการจัดการเรียนรู้ : "); | ||
|
||
document.getElementById("show_score_cir").innerHTML = "คะแนนของคุณ : " + number1; | ||
document.getElementById("show_score_tec").innerHTML = "คะแนนของคุณ : " + number2; | ||
document.getElementById("show_score_pp").innerHTML = "คะแนนของคุณ : " + number3; | ||
document.getElementById("show_score_edu").innerHTML = "คะแนนของคุณ : " + number4; | ||
|
||
if (number1 >= 80) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : A 'ผ่าน' "; | ||
} else if (number1 >= 75 && number1 <= 79) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : B+ 'ผ่าน' "; | ||
} else if (number1 >= 70 && number1 <= 74) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : B 'ผ่าน' "; | ||
} else if (number1 >= 65 && number1 <= 69) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : C+ 'ผ่าน' "; | ||
} else if (number1 >= 60 && number1 <= 64) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : C 'ผ่าน' "; | ||
} else if (number1 >= 55 && number1 <= 59) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : D+ 'ผ่าน' "; | ||
} else if (number1 >= 50 && number1 <= 54) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : D 'ผ่าน' "; | ||
} else if (number1 < 50) { | ||
document.getElementById("show_score_cir1").innerHTML = "เกรดของคุณ : F 'ผ่าน' "; | ||
} else if (number1 == "") { | ||
document.getElementById("show_score_cir1").innerHTML = "กรุณาใส่ข้อมูล"; | ||
} else if (isNaN(number1)) { | ||
document.getElementById("show_score_cir1").innerHTML = "ข้อมูลไม่ถูกต้อง"; | ||
} | ||
|
||
if (number2 >= 80) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : A 'ผ่าน' "; | ||
} else if (number2 >= 75 && number2 <= 79) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : B+ 'ผ่าน' "; | ||
} else if (number2 >= 70 && number2 <= 74) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : B 'ผ่าน' "; | ||
} else if (number2 >= 65 && number2 <= 69) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : C+ 'ผ่าน' "; | ||
} else if (number2 >= 60 && number2 <= 64) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : C 'ผ่าน' "; | ||
} else if (number2 >= 55 && number2 <= 59) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : D+ 'ผ่าน' "; | ||
} else if (number2 >= 50 && number2 <= 54) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : D 'ผ่าน' "; | ||
} else if (number2 < 50) { | ||
document.getElementById("show_score_tec1").innerHTML = "เกรดของคุณ : F 'ผ่าน' "; | ||
} else if (number2 == "") { | ||
document.getElementById("show_score_tec1").innerHTML = "กรุณาใส่ข้อมูล"; | ||
} else if (isNaN(number2)) { | ||
document.getElementById("show_score_tec1").innerHTML = "ข้อมูลไม่ถูกต้อง"; | ||
} | ||
|
||
if (number3 >= 80) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : A 'ผ่าน' "; | ||
} else if (number3 >= 75 && number3 <= 79) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : B+ 'ผ่าน' "; | ||
} else if (number3 >= 70 && number3 <= 74) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : B 'ผ่าน' "; | ||
} else if (number3 >= 65 && number3 <= 69) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : C+ 'ผ่าน' "; | ||
} else if (number3 >= 60 && number3 <= 64) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : C 'ผ่าน' "; | ||
} else if (number3 >= 55 && number3 <= 59) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : D+ 'ผ่าน' "; | ||
} else if (number3 >= 50 && number3 <= 54) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : D 'ผ่าน' "; | ||
} else if (number3 < 50) { | ||
document.getElementById("show_score_pp1").innerHTML = "เกรดของคุณ : F 'ผ่าน' "; | ||
} else if (number3 == "") { | ||
document.getElementById("show_score_pp1").innerHTML = "กรุณาใส่ข้อมูล"; | ||
} else if (isNaN(number3)) { | ||
document.getElementById("show_score_pp1").innerHTML = "ข้อมูลไม่ถูกต้อง"; | ||
} | ||
|
||
if (number4 >= 80) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : A 'ผ่าน' "; | ||
} else if (number4 >= 75 && number4 <= 79) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : B+ 'ผ่าน' "; | ||
} else if (number4 >= 70 && number4 <= 74) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : B 'ผ่าน' "; | ||
} else if (number4 >= 65 && number4 <= 69) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : C+ 'ผ่าน' "; | ||
} else if (number4 >= 60 && number4 <= 64) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : C 'ผ่าน' "; | ||
} else if (number4 >= 55 && number4 <= 59) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : D+ 'ผ่าน' "; | ||
} else if (number4 >= 50 && number4 <= 54) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : D 'ผ่าน' "; | ||
} else if (number4 < 50) { | ||
document.getElementById("show_score_edu1").innerHTML = "เกรดของคุณ : F 'ผ่าน' "; | ||
} else if (number4 == "") { | ||
document.getElementById("show_score_edu1").innerHTML = "กรุณาใส่ข้อมูล"; | ||
} else if (isNaN(number4)) { | ||
document.getElementById("show_score_edu1").innerHTML = "ข้อมูลไม่ถูกต้อง"; | ||
} | ||
|
||
let a = number1 | ||
let b = number2 | ||
let c = number3 | ||
let d = number4 | ||
|
||
document.getElementById("showxbar").innerHTML = "คะแนนเฉลี่ย : " + (a / 4 + b / 4 + c / 4 + d / 4); | ||
document.getElementById("showxbar").style.display = "block"; | ||
document.getElementById("bst1").style.display = "block"; | ||
document.getElementById("bst").style.display = "none"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
h1 { | ||
text-align: center; | ||
} | ||
|
||
.bbox { | ||
/* margin-left: 680px; */ | ||
margin-left: 875px; | ||
} | ||
|
||
p { | ||
font-size: 1.25rem; | ||
} | ||
|
||
.head1, .head2 { | ||
/* margin-left: 450px; */ | ||
margin-left: 625px; | ||
} | ||
|
||
h1, h3 { | ||
text-decoration: underline; | ||
} | ||
|
||
.box1, .box2 { | ||
margin: 20px; | ||
padding: 20px; | ||
padding-left: 50px; | ||
background-color: #ffffff; | ||
border: 5px solid; | ||
box-shadow: 10px 10px 5px lightblue; | ||
width: 200px; | ||
display: inline-block; | ||
} | ||
|
||
.box3, .box4 { | ||
margin: 20px; | ||
padding: 20px; | ||
padding-left: 50px; | ||
background-color: #ffffff; | ||
border: 5px solid; | ||
box-shadow: 10px 10px 5px lightblue; | ||
width: 200px; | ||
display: inline-block; | ||
} | ||
|
||
.buttonx { | ||
background-color: #000000; | ||
border: none; | ||
color: #ffffff; | ||
padding: 15px 32px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 1rem; | ||
margin: 4px 2px; | ||
cursor: pointer; | ||
-webkit-transition-duration: 0.4s; | ||
transition-duration: 0.4s; | ||
} | ||
|
||
.buttonx2 { | ||
background-color: #000000; | ||
border: none; | ||
color: #ffffff; | ||
padding: 15px 32px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 1rem; | ||
margin: 4px 2px; | ||
cursor: pointer; | ||
-webkit-transition-duration: 0.4s; | ||
transition-duration: 0.4s; | ||
} | ||
|
||
.buttonx:hover { | ||
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0, 24), 0 17px 50px 0 rgba(0, 0, 0, 0, 19); | ||
} | ||
|
||
.buttonx2:hover { | ||
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0, 24), 0 17px 50px 0 rgba(0, 0, 0, 0, 19); | ||
} | ||
|
||
.score { | ||
display: inline; | ||
} | ||
|
||
.bs { | ||
margin-left: 10px; | ||
} | ||
|
||
.textshowxbar { | ||
margin-left: 640px; | ||
} |