mod02.html 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <link href="https://rsms.me/inter/inter.css" rel="stylesheet" />
  8. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
  9. <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.full.js"></script>
  10. <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.css" rel="stylesheet" />
  11. <title>Module 2 Advanced CSS Challenge Rubric</title>
  12. <style>
  13. *,
  14. *::before,
  15. *::after {
  16. box-sizing: border-box;
  17. }
  18. html,
  19. body {
  20. margin: 0;
  21. padding: 0;
  22. line-height: 1.15;
  23. font-size: 100%;
  24. color: #fefefe;
  25. transition: all 0.4s;
  26. }
  27. body {
  28. background-color: #fbfcfd;
  29. font-family: "Inter", sans-serif;
  30. color: #4a4a4a;
  31. }
  32. #app.dark {
  33. background-color: #121212;
  34. color: #e2e2e2;
  35. }
  36. h1 {
  37. font-size: 1.9rem;
  38. }
  39. h2 {
  40. font-size: 1.6rem;
  41. }
  42. h3 {
  43. font-size: 1.2rem;
  44. }
  45. h4 {
  46. font-size: 0.9rem;
  47. }
  48. p,
  49. legend {
  50. font-size: 1.2rem;
  51. }
  52. label {
  53. font-size: 0.9rem;
  54. line-height: 2;
  55. }
  56. fieldset {
  57. border: none;
  58. padding: 0;
  59. margin-top: 0.9rem;
  60. }
  61. input[type="radio"],
  62. input[type="checkbox"] {
  63. position: absolute !important;
  64. height: 1px;
  65. width: 1px;
  66. overflow: hidden;
  67. clip: rect(1px 1px 1px 1px);
  68. clip: rect(1px, 1px, 1px, 1px);
  69. white-space: nowrap;
  70. }
  71. .select-lg,
  72. .select-lg option {
  73. font-family: "Inter", sans-serif;
  74. padding: 10px;
  75. }
  76. .narrow {
  77. width: 800px;
  78. }
  79. #app {
  80. padding: 3%;
  81. transition: all 0.4s;
  82. }
  83. #app h1 {
  84. font-size: 1.9rem;
  85. font-weight: 700;
  86. line-height: 1.3;
  87. }
  88. header {
  89. display: flex;
  90. justify-content: space-between;
  91. align-items: center;
  92. }
  93. .switch-group {
  94. display: flex;
  95. align-items: center;
  96. height: 2.25rem;
  97. width: 4.5rem;
  98. }
  99. input[type="checkbox"]+.toggle {
  100. height: 100%;
  101. width: 100%;
  102. background-color: #77a1db;
  103. border-radius: 1.9rem;
  104. cursor: pointer;
  105. display: flex;
  106. align-items: center;
  107. padding: 0.35rem;
  108. cursor: pointer;
  109. overflow: hidden;
  110. background-position: 25% 125%;
  111. transition: all 0.5s;
  112. }
  113. input[type="checkbox"]:focus+.toggle {
  114. outline: rgb(59, 153, 252) auto 5px;
  115. }
  116. input[type="checkbox"]:checked+.toggle {
  117. background-color: rgb(85, 89, 204);
  118. background-size: 1rem;
  119. background-repeat: no-repeat;
  120. background-position: 25%;
  121. background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMSIgY3k9IjgiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjgiIGN5PSI3IiByPSIxIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSI1IiBjeT0iMTMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjUiIGN5PSIyIiByPSIyIiBmaWxsPSJ3aGl0ZSIvPgo8Y2lyY2xlIGN4PSIxMyIgY3k9IjMiIHI9IjEiIGZpbGw9IndoaXRlIi8+CjxjaXJjbGUgY3g9IjEyLjUiIGN5PSI5LjUiIHI9IjEuNSIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==");
  122. transition: all 0.5s;
  123. }
  124. input[type="checkbox"]+.toggle::after {
  125. content: "";
  126. display: block;
  127. height: 1.7rem;
  128. width: 1.7rem;
  129. border-radius: 50%;
  130. cursor: pointer;
  131. border: 4px solid #e1be64;
  132. background-color: #fddf74;
  133. transform: translateX(0rem);
  134. transition: all 0.5s;
  135. background-position: center bottom;
  136. }
  137. input[type="checkbox"]:hover+.toggle::after {
  138. transform: translateX(0rem) scale(1.1);
  139. }
  140. input[type="checkbox"]:checked+.toggle::after {
  141. border: 4px solid #ffffff;
  142. background-color: rgba(255, 255, 255, 0.4);
  143. transform: translateX(2.1rem);
  144. transition: all 0.5s;
  145. background-position: center;
  146. background-size: 60%;
  147. background-repeat: no-repeat;
  148. background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE4LjUgMTAuMjlDMTguMzQyNyAxMS45OTIyIDE3LjcwMzkgMTMuNjE0NCAxNi42NTgyIDE0Ljk2NjhDMTUuNjEyNiAxNi4zMTkyIDE0LjIwMzUgMTcuMzQ1OCAxMi41OTU3IDE3LjkyNjVDMTAuOTg3OSAxOC41MDczIDkuMjQ3OTggMTguNjE4MSA3LjU3OTUgMTguMjQ2MUM1LjkxMTAyIDE3Ljg3NDEgNC4zODI5OSAxNy4wMzQ1IDMuMTc0MjMgMTUuODI1OEMxLjk2NTQ2IDE0LjYxNyAxLjEyNTk0IDEzLjA4OSAwLjc1MzkwNyAxMS40MjA1QzAuMzgxODc1IDkuNzUyMDIgMC40OTI3MTYgOC4wMTIwOCAxLjA3MzQ2IDYuNDA0M0MxLjY1NDIgNC43OTY1MSAyLjY4MDgzIDMuMzg3MzcgNC4wMzMyMSAyLjM0MTc1QzUuMzg1NTkgMS4yOTYxNCA3LjAwNzggMC42NTczMDUgOC43MSAwLjVDNy43MTM0MSAxLjg0ODI3IDcuMjMzODUgMy41MDk0NSA3LjM1ODUzIDUuMTgxNDFDNy40ODMyMSA2Ljg1MzM4IDguMjAzODYgOC40MjUwNiA5LjM4OTQgOS42MTA2QzEwLjU3NDkgMTAuNzk2MSAxMi4xNDY2IDExLjUxNjggMTMuODE4NiAxMS42NDE1QzE1LjQ5MDYgMTEuNzY2MiAxNy4xNTE3IDExLjI4NjYgMTguNSAxMC4yOVYxMC4yOVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=");
  149. }
  150. input[type="checkbox"]:checked:hover+.toggle::after {
  151. transform: translateX(2.1rem) scale(1.075);
  152. }
  153. .card {
  154. background-color: #fff;
  155. border-radius: 6px;
  156. border-width: 0;
  157. box-shadow: rgba(155, 155, 155, 0.45) 0 0 30px -5px;
  158. font-size: 1.1rem;
  159. height: 100%;
  160. line-height: 1.8rem;
  161. padding: 1.5rem 2rem;
  162. width: 100%;
  163. margin-bottom: 1.9rem;
  164. }
  165. .dark .card {
  166. background-color: #333333;
  167. box-shadow: none;
  168. }
  169. .card h1,
  170. .card h2,
  171. .card h3,
  172. .card h4,
  173. .card h5,
  174. .card h6 {
  175. color: #4a4a4a;
  176. }
  177. .dark .card h1,
  178. .dark .card h2,
  179. .dark .card h3,
  180. .dark .card h4,
  181. .dark .card h5,
  182. .dark .card h6 {
  183. color: #e2e2e2;
  184. }
  185. .card-header h2 {
  186. display: inline-block;
  187. }
  188. .card .cat-score {
  189. margin-left: 20px;
  190. font-size: smaller;
  191. }
  192. .card h3 {
  193. font-size: 1.2rem;
  194. font-weight: 700;
  195. line-height: 1.8em;
  196. margin: 0;
  197. padding: 0;
  198. }
  199. .card p,
  200. .card label,
  201. .card legend {
  202. color: #7a869c;
  203. border-width: 0;
  204. display: block;
  205. font-size: 1.1rem;
  206. font-weight: 300;
  207. line-height: 1.8em;
  208. margin: 0;
  209. padding: 0;
  210. }
  211. .card legend {
  212. display: flex;
  213. justify-content: flex-start;
  214. align-items: center;
  215. }
  216. .card legend .score {
  217. font-size: smaller;
  218. margin-left: 20px;
  219. font-weight: 100;
  220. min-width: 5%;
  221. }
  222. .dark .card p,
  223. .dark .card label,
  224. .dark .card legend {
  225. color: #e2e2e2;
  226. }
  227. .card label {
  228. display: inline-block;
  229. }
  230. .card input[type="radio"]+label::before {
  231. content: "";
  232. height: 0.9rem;
  233. width: 0.9rem;
  234. margin-right: 0.7rem;
  235. border-radius: 50%;
  236. border: 1px solid rgb(74, 74, 74);
  237. background-color: #ffffff;
  238. display: inline-block;
  239. cursor: pointer;
  240. position: relative;
  241. top: 0.09rem;
  242. }
  243. .dark .card input[type="radio"]+label::before {
  244. border: 1px solid #e2e2e2;
  245. background-color: inherit;
  246. }
  247. .card input[type="radio"]:checked+label::before {
  248. background-color: rgb(47, 106, 189);
  249. border-color: rgb(47, 106, 189);
  250. }
  251. .dark .card input[type="radio"]:checked+label::before {
  252. background-color: #d9d9d9;
  253. border-color: #d9d9d9;
  254. }
  255. .card input[type="radio"]:checked+label {
  256. font-weight: bold;
  257. color: #4a4a4a;
  258. }
  259. .dark input[type="radio"]:checked+label {
  260. color: #e2e2e2;
  261. }
  262. .card input[type="radio"]:focus+label::before {
  263. outline: rgb(59, 153, 252) auto 5px;
  264. }
  265. .card legend {
  266. margin-bottom: 0.4rem;
  267. }
  268. .totals {
  269. font-size: 1.6rem;
  270. }
  271. .totals+h2 {
  272. font-size: 1.9rem;
  273. margin-top: 0;
  274. }
  275. .grade {
  276. font-size: 1.9rem;
  277. }
  278. button {
  279. background-color: #fff;
  280. border: 1px solid #4a4a4a;
  281. border-radius: 6px;
  282. box-shadow: rgba(155, 155, 155, 0.5) 1px 2px 3px 0;
  283. color: #4a4a4a;
  284. cursor: pointer;
  285. display: inline-block;
  286. font-size: 1rem;
  287. font-weight: 500;
  288. letter-spacing: 0.04em;
  289. line-height: 1.8em;
  290. margin: 0.75rem 1.1rem 1.1rem 0;
  291. outline: none;
  292. padding: 0.5rem 1.4rem;
  293. text-transform: uppercase;
  294. transition-delay: 0s;
  295. transition-duration: 0.25s;
  296. transition-property: all;
  297. transition-timing-function: ease-out;
  298. width: fit-content;
  299. }
  300. .dark button {
  301. background: #d9d9d9;
  302. color: #121212;
  303. box-shadow: none;
  304. }
  305. button:hover {
  306. border-color: #dbdbdb;
  307. color: #dbdbdb;
  308. }
  309. .dark button:hover {
  310. color: #121212;
  311. }
  312. button.copy {
  313. margin-left: 0.4rem;
  314. font-size: .8rem;
  315. }
  316. button:focus {
  317. border-color: rgb(56, 56, 56);
  318. box-shadow: rgb(219, 219, 219) 0px 0px 0px 3px;
  319. color: rgb(56, 56, 56);
  320. }
  321. div[role="alert"] {
  322. color: #4a4a4a;
  323. font-size: 1.2rem;
  324. margin-bottom: 1.2rem;
  325. }
  326. .dark div[role="alert"] {
  327. color: #e2e2e2;
  328. }
  329. .summary {
  330. font-size: 1.2rem;
  331. border: none;
  332. font-family: monospace;
  333. background-color: #d5d9de;
  334. padding: 0.9rem;
  335. border-radius: 6px;
  336. line-height: 1.5;
  337. width: 100%;
  338. }
  339. .summary h2,
  340. .dark .summary h2 {
  341. font-size: 1.2rem;
  342. font-family: "Inter", sans-serif;
  343. margin-top: 35px;
  344. margin-bottom: 5px;
  345. }
  346. .summary h2:first-of-type,
  347. .dark .summary h2:first-of-type {
  348. margin-top: 15px;
  349. }
  350. .dark .summary {
  351. background: #6b6a6a;
  352. color: #e2e2e2;
  353. }
  354. .summary pre,
  355. .dark .summary pre {
  356. white-space: pre-wrap;
  357. border-radius: 5px;
  358. padding: 15px;
  359. border: solid 2px rgba(0, 0, 0, .4);
  360. }
  361. .summary pre:empty {
  362. display: none;
  363. }
  364. .summary pre:empty+button {
  365. display: none;
  366. }
  367. .d-none {
  368. display: none;
  369. }
  370. @media (max-width: 450px) {
  371. .btn-container {
  372. text-align: center;
  373. }
  374. button {
  375. width: 100%;
  376. margin: 0.5rem;
  377. }
  378. input[type="checkbox"]:checked+.toggle::after {
  379. transform: translateX(1.3rem);
  380. background-size: 50%;
  381. }
  382. input[type="checkbox"]:checked:hover+.toggle::after {
  383. transform: translateX(1.3rem) scale(1.1);
  384. background-size: 50%;
  385. }
  386. }
  387. @media (max-width: 515px) {
  388. input[type="checkbox"]:checked+.toggle::after {
  389. transform: translateX(1.7rem);
  390. }
  391. input[type="checkbox"]:checked:hover+.toggle::after {
  392. transform: translateX(1.7rem) scale(1.1);
  393. }
  394. }
  395. @media (max-width: 460px) {
  396. input[type="checkbox"]:checked+.toggle::after {
  397. transform: translateX(1.4rem);
  398. }
  399. input[type="checkbox"]:checked:hover+.toggle::after {
  400. transform: translateX(1.4rem) scale(1.1);
  401. }
  402. }
  403. @media (max-width: 400px) {
  404. #app h1 {
  405. font-size: 1.6rem;
  406. }
  407. input[type="checkbox"]:checked+.toggle::after {
  408. transform: translateX(1.3rem);
  409. }
  410. input[type="checkbox"]:checked:hover+.toggle::after {
  411. transform: translateX(1.3rem) scale(1.1);
  412. }
  413. }
  414. @media (max-width: 340px) {
  415. input[type="checkbox"]:checked+.toggle::after {
  416. transform: translateX(0.9rem);
  417. }
  418. input[type="checkbox"]:checked:hover+.toggle::after {
  419. transform: translateX(0.9rem) scale(1.075);
  420. }
  421. }
  422. </style>
  423. <script>
  424. $(function () {
  425. let $select2 = $('.select2').select2({
  426. containerCssClass: "wrap"
  427. })
  428. function triggerEvent(name, val) {
  429. let selected = $("select[name='" + name + "']")
  430. let change = new Event('change', { bubbles: true })
  431. selected[0].dispatchEvent(change)
  432. }
  433. $('.select2').on('select2:select', function (e) {
  434. triggerEvent(e.target.name, e.target.value)
  435. });
  436. })
  437. </script>
  438. </head>
  439. <body>
  440. <div id="app"></div>
  441. <script>
  442. (function (window) {
  443. "use strict";
  444. function Model() {
  445. this.title = `Module 2 Advanced CSS Challenge Rubric (Coding)`;
  446. this.categories = [
  447. {
  448. title: "Deployment",
  449. subtitle: null,
  450. score: 0,
  451. questions: [
  452. {
  453. title: "Student submitted deployed live application URL",
  454. score: 8,
  455. type: "true false",
  456. message: "Application isn't deployed",
  457. status: false
  458. },
  459. {
  460. title:
  461. "Application loads at deployed URL (no 404, or Heroku/GH Pages error)",
  462. score: 8,
  463. type: "true false",
  464. message: "Application isn't deployed",
  465. status: false
  466. },
  467. {
  468. title: "Student submitted application GitHub URL",
  469. score: 8,
  470. type: "true false",
  471. message: "Missing GitHub submission URL",
  472. status: false
  473. },
  474. {
  475. title: "GitHub Repo contains application code",
  476. score: 8,
  477. type: "true false",
  478. message: "GitHub repo is empty",
  479. status: false
  480. }
  481. ]
  482. },
  483. {
  484. title: "Technical Acceptance Criteria",
  485. subtitle:
  486. "Keep your browser console open and watch out for errors from this point forward.",
  487. score: 0,
  488. questions: [
  489. {
  490. title:
  491. "Application includes the student's name at the top of the portfolio",
  492. score: 5,
  493. type: "true false",
  494. message: "Application doesn't include the student's name at the top of the portfolio",
  495. status: false
  496. },
  497. {
  498. title:
  499. "Application includes a photo or avatar of the student",
  500. score: 5,
  501. type: "true false",
  502. message: "Application doesn't include a photo or avatar of the student",
  503. status: false
  504. },
  505. {
  506. title: "The application's navigation includes links to sections about them, their work, and how to contact them",
  507. score: 5,
  508. type: "likert",
  509. options: [
  510. {
  511. message: "The application's navigation doesn't include links to sections about them, their work, and how to contact them",
  512. score: 0
  513. },
  514. {
  515. message: "The application's navigation is missing links to 2 of the following sections: about, work, or contact",
  516. score: 1
  517. },
  518. {
  519. message: "The application's navigation is missing a link to 1 of the following sections: about, work, or contact",
  520. score: 3
  521. },
  522. {
  523. message: "The application's navigation includes links to sections about them, their work, and how to contact them",
  524. score: 5
  525. }
  526. ],
  527. message: "",
  528. status: false
  529. },
  530. {
  531. title: "The application's navigation links to each corresponding section on the page",
  532. score: 5,
  533. type: "likert",
  534. options: [
  535. {
  536. message: "The application's navigation doesn't link to each corresponding section on the page",
  537. score: 0
  538. },
  539. {
  540. message: "The application's navigation links to 1 of the 3 sections on the page",
  541. score: 1
  542. },
  543. {
  544. message: "The application's navigation links to 2 of the 3 sections on the page",
  545. score: 3
  546. },
  547. {
  548. message: "The application's navigation links to each corresponding section on the page",
  549. score: 5
  550. }
  551. ],
  552. message: "",
  553. status: false
  554. },
  555. {
  556. title: "The section about the student's work contains titled images of the student's applications (or placeholders)",
  557. score: 5,
  558. type: "likert",
  559. options: [
  560. {
  561. message: "The section about the student's work doesn't contain titled images of the student's applications (or placeholders)",
  562. score: 0
  563. },
  564. {
  565. message: "The section about the student's work contains titled images for some of the student's applications (or placeholders)",
  566. score: 3
  567. },
  568. {
  569. message: "The section about the student's work contains titled images for all of the student's applications (or placeholders)",
  570. score: 5
  571. }
  572. ],
  573. message: "",
  574. status: false
  575. },
  576. {
  577. title:
  578. "In the application's section about their work, the first image is larger in size than the others",
  579. score: 5,
  580. type: "true false",
  581. message:
  582. "In the application's section about their work, the first image isn't larger in size than the others",
  583. status: false
  584. },
  585. {
  586. title:
  587. "Clicking on a featured application opens that deployed application (at least one application, in case they are using placeholders)",
  588. score: 5,
  589. type: "true false",
  590. message:
  591. "Clicking on a featured application doesn't open that deployed application (at least one application, in case they are using placeholders)",
  592. status: false
  593. },
  594. {
  595. title:
  596. "The application adapts to the viewport with a responsive layout by resizing the page on various screens and devices",
  597. score: 5,
  598. type: "true false",
  599. message: "The application doesn't adapt to the viewport with a responsive layout by resizing the page on various screens and devices",
  600. status: false
  601. }
  602. ]
  603. },
  604. {
  605. title: "Repository Quality",
  606. subtitle: null,
  607. score: 0,
  608. questions: [
  609. {
  610. title: "Repository has a unique name",
  611. score: 2,
  612. type: "true false",
  613. message: "Repo doesn't have a unique name",
  614. status: false
  615. },
  616. {
  617. title:
  618. "Repository follows best practices for file structure and naming conventions",
  619. score: 2,
  620. type: "true false",
  621. message:
  622. "Code doesn't follow recommended file/folder structure",
  623. status: false
  624. },
  625. {
  626. title:
  627. "Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.",
  628. score: 2,
  629. type: "true false",
  630. message:
  631. "Code doesn't follow good practices for class/id names, indentation, lacks quality comments",
  632. status: false
  633. },
  634. {
  635. title:
  636. "Repository contains multiple descriptive commit messages",
  637. score: 2,
  638. type: "true false",
  639. message:
  640. "Repo doesn't contain multiple descriptive commit messages",
  641. status: false
  642. },
  643. {
  644. title: "Repository contains quality README with description, screenshot, link to deployed application",
  645. score: 5,
  646. type: "likert",
  647. options: [
  648. {
  649. message: "Repo doesn't include a high quality README with screenshots, a description, link to deployed application",
  650. score: 0
  651. },
  652. {
  653. message: "Repository README is missing 2 of the following: description, screenshot, or link to deployed application",
  654. score: 2
  655. },
  656. {
  657. message: "Repository README is missing 1 of the following: description, screenshot, or link to deployed application",
  658. score: 4
  659. },
  660. {
  661. message: "Repository contains quality README with description, screenshot, link to deployed application",
  662. score: 5
  663. }
  664. ],
  665. message: "",
  666. status: false
  667. }
  668. ]
  669. },
  670. {
  671. title: "Application Quality",
  672. subtitle: null,
  673. score: 0,
  674. questions: [
  675. {
  676. title: "Application resembles the mock-up functionality provided in Challenge instructions",
  677. score: 15,
  678. type: "likert",
  679. options: [
  680. {
  681. message: "Application does not resemble the mock-up functionality provided in Challenge instructions",
  682. score: 0
  683. },
  684. {
  685. message: "Application could resemble the mock-up functionality provided in Challenge instructions a lot more closely",
  686. score: 5
  687. },
  688. {
  689. message: "Application could resemble the mock-up functionality provided in Challenge instructions a bit more closely",
  690. score: 10
  691. },
  692. {
  693. message: "Application resembles the mock-up functionality provided in Challenge instructions",
  694. score: 15
  695. }
  696. ],
  697. message: "",
  698. status: false
  699. }
  700. ]
  701. },
  702. {
  703. title: "Academic Integrity",
  704. subtitle:
  705. "If any of of the following are true, partner with your instructor to investigate plagiarism. Contact your SSM if you believe plagiarism has occurred.",
  706. score: 0,
  707. questions: [
  708. {
  709. title: "Application contains a low number of commits",
  710. score: 0,
  711. type: "true false",
  712. message: null,
  713. status: false
  714. },
  715. {
  716. title:
  717. "Application codebase appears advanced for the student, at this point in the course, or in general",
  718. score: 0,
  719. type: "true false",
  720. message: null,
  721. status: false
  722. },
  723. {
  724. title:
  725. "Application package.json file references a different author and/or repository",
  726. score: 0,
  727. type: "true false",
  728. message: null,
  729. status: false
  730. },
  731. {
  732. title:
  733. "Application package.json file references much older versions of npm packages",
  734. score: 0,
  735. type: "true false",
  736. message: null,
  737. status: false
  738. }
  739. ]
  740. }
  741. ];
  742. this.initStorage();
  743. }
  744. Model.prototype.initStorage = function () {
  745. this.score = 0;
  746. this.questions = [];
  747. this.messages = new Set();
  748. this.flagged = new Set();
  749. this.isDarkMode =
  750. JSON.parse(localStorage.getItem("isDarkMode")) || false;
  751. this.categories
  752. .forEach(category => {
  753. category.score = 0;
  754. category.questions.forEach(question => {
  755. question.category = category.title;
  756. question.status = false;
  757. question.id = this.questions.length;
  758. question.flagged = category.title === "Academic Integrity";
  759. question.bonus = category.title === "Bonus";
  760. if (question.type === "likert") {
  761. question.message = question.options[0].message.split(" - ").pop();
  762. };
  763. let messageObj = {
  764. message: question.message,
  765. category: question.category
  766. };
  767. question.message && !question.bonus && this.messages.add(messageObj);
  768. this.questions.push(question);
  769. category.score += question.score;
  770. });
  771. });
  772. };
  773. Model.prototype.toggleDarkMode = function () {
  774. this.isDarkMode = !this.isDarkMode;
  775. localStorage.setItem("isDarkMode", this.isDarkMode);
  776. };
  777. Model.prototype.toggleRadio = function (radio) {
  778. const id = Number(radio.getAttribute("name"));
  779. const question = this.questions[id];
  780. const questionScore = document.querySelector("span[data-id='" + id + "']");
  781. const category = question.category;
  782. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  783. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  784. question.status = !question.status;
  785. if (question.status === true) {
  786. if (!question.bonus) {
  787. this.messages.forEach(message => {
  788. if (message.message === question.message) {
  789. this.messages.delete(message);
  790. }
  791. })
  792. } else {
  793. let messageObj = {
  794. message: question.message,
  795. category: category
  796. }
  797. this.messages.add(messageObj);
  798. }
  799. this.score += question.score;
  800. if (question.flagged) {
  801. this.flagged.add(question.id);
  802. }
  803. } else {
  804. if (question.flagged) {
  805. this.flagged.delete(question.id);
  806. }
  807. if (!question.bonus) {
  808. if (question.message) {
  809. let messageObj = {
  810. message: question.message,
  811. category: category
  812. }
  813. this.messages.add(messageObj);
  814. }
  815. } else {
  816. this.messages.forEach(message => {
  817. if (message.message === question.message) {
  818. this.messages.delete(message);
  819. }
  820. })
  821. }
  822. this.score -= question.score;
  823. }
  824. if (category !== "Academic Integrity") {
  825. if (question.status) {
  826. questionScore.textContent = question.score;
  827. } else {
  828. questionScore.textContent = 0;
  829. }
  830. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  831. let categoryTotal = 0;
  832. catQuestions.forEach(question => {
  833. if (question.type === "true false") {
  834. if (question.status) {
  835. categoryTotal += question.score;
  836. }
  837. } else {
  838. let score = document.querySelector("select[name='" + question.id + "']").value;
  839. categoryTotal += parseInt(score);
  840. }
  841. })
  842. categoryScore.textContent = categoryTotal;
  843. resultsCategoryScore.textContent = categoryTotal;
  844. }
  845. };
  846. Model.prototype.handleSelect = function (select) {
  847. const id = Number(select.getAttribute("name"));
  848. const question = this.questions[id];
  849. const questionScore = document.querySelector("span[data-id='" + id + "']");
  850. const oldScore = questionScore.textContent;
  851. const category = question.category;
  852. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  853. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  854. let newMessage = select.selectedOptions[0].text.split(" - ").pop();
  855. if (newMessage === "Open this menu") {
  856. newMessage = select[1].text.split(" - ").pop();
  857. };
  858. if (question.type === "likert") {
  859. this.messages.forEach(item => {
  860. if (item.message === question.message) {
  861. this.messages.delete(item)
  862. }
  863. })
  864. question.message = newMessage;
  865. let messageObj = {
  866. message: newMessage,
  867. category: category
  868. }
  869. this.messages.add(messageObj);
  870. };
  871. this.score -= parseInt(oldScore);
  872. this.score += parseInt(select.value);
  873. questionScore.textContent = select.value;
  874. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  875. let categoryTotal = 0;
  876. catQuestions.forEach(question => {
  877. if (question.type === "true false") {
  878. if (question.status) {
  879. categoryTotal += question.score;
  880. }
  881. } else {
  882. let score = document.querySelector("select[name='" + question.id + "']").value;
  883. categoryTotal += parseInt(score);
  884. }
  885. })
  886. categoryScore.textContent = categoryTotal;
  887. resultsCategoryScore.textContent = categoryTotal;
  888. };
  889. Model.prototype.calcGrade = function () {
  890. const roundedScore = Math.min(100, Math.ceil(this.score));
  891. let letterGrade = "";
  892. if (roundedScore >= 99.5) {
  893. letterGrade = "A+";
  894. } else if (roundedScore >= 94.5 && roundedScore <= 99.4) {
  895. letterGrade = "A";
  896. } else if (roundedScore >= 91.5 && roundedScore <= 94.4) {
  897. letterGrade = "A-";
  898. } else if (roundedScore >= 87.5 && roundedScore <= 91.4) {
  899. letterGrade = "B+";
  900. } else if (roundedScore >= 84.5 && roundedScore <= 87.4) {
  901. letterGrade = "B";
  902. } else if (roundedScore >= 81.5 && roundedScore <= 84.4) {
  903. letterGrade = "B-";
  904. } else if (roundedScore >= 77.5 && roundedScore <= 81.4) {
  905. letterGrade = "C+";
  906. } else if (roundedScore >= 74.5 && roundedScore <= 77.4) {
  907. letterGrade = "C";
  908. } else if (roundedScore >= 71.5 && roundedScore <= 74.4) {
  909. letterGrade = "C-";
  910. } else if (roundedScore >= 69.5 && roundedScore <= 71.4) {
  911. letterGrade = "D+";
  912. } else if (roundedScore >= 64.5 && roundedScore <= 69.4) {
  913. letterGrade = "D";
  914. } else if (roundedScore >= 61.5 && roundedScore <= 64.4) {
  915. letterGrade = "D-";
  916. } else {
  917. letterGrade = "F";
  918. }
  919. return letterGrade;
  920. };
  921. Model.prototype.hasFlags = function () {
  922. return this.flagged.size > 0;
  923. };
  924. function View(model) {
  925. this.model = model;
  926. this.generateHTML();
  927. this.cacheDom();
  928. }
  929. View.prototype.cacheDom = function () {
  930. this.darkModeToggle = document.querySelector("#dark-mode");
  931. this.radios = Array.from(
  932. document.querySelectorAll("input[type='radio']")
  933. );
  934. this.selects = Array.from(
  935. document.querySelectorAll("select")
  936. );
  937. this.totals = document.querySelector(".totals");
  938. this.grade = document.querySelector(".grade");
  939. this.alert = document.querySelector("div[role='alert']");
  940. this.summaryHeading = document.querySelector(".summary-heading");
  941. this.summary = document.querySelector(".summary");
  942. this.model.categories
  943. .filter(category => category.title !== "Academic Integrity")
  944. .map(category => {
  945. let summary = category.title.replace(/\s+/g, '-').toLowerCase();
  946. let summaryName = summary + "-summary";
  947. return this[summaryName] = document.querySelector("." + summary);
  948. })
  949. this.resetButton = document.querySelector(".reset");
  950. this.model.categories
  951. .filter(category => category.title !== "Academic Integrity")
  952. .map(category => {
  953. let button = category.title.replace(/\s+/g, '-').toLowerCase();
  954. let buttonName = "copyButton-" + button;
  955. return this[buttonName] = document.querySelector(".copy-" + button);
  956. })
  957. };
  958. View.prototype.createFieldset = function ({ title, id, score, status, category, type, options }) {
  959. return `<fieldset class="input-group">
  960. <legend>
  961. <span class="title">${title}</span> ${category === "Academic Integrity" ? "" : "<span class='score'><span data-id='" + id + "' class='current-score'>0</span> / " + score + "</span>"}
  962. </legend>
  963. ${type === "true false" ?
  964. `<div class="radio-group">
  965. <input type="radio" name="${id}" id="${id}-true" value="true">
  966. <label for="${id}-true">True</label>
  967. </div>
  968. <div class="radio-group">
  969. <input type="radio" name="${id}" id="${id}-false" value="false" checked>
  970. <label for="${id}-false">False</label>
  971. </div>` :
  972. `<div class="select-group">
  973. <select name="${id}" class="select-lg select2 narrow wrap">
  974. <option value="0" selected>Open this menu</option>
  975. ${options.map(option => `<option value="${option.score}">${option.score} - ${option.message}</option>`)}
  976. </select>
  977. </div>`
  978. }
  979. </fieldset>`;
  980. };
  981. View.prototype.createCard = function ({ title, subtitle, questions, score }) {
  982. return `<div class="card">
  983. <div class="card-header"><h2>${title}</h2> ${title !== "Academic Integrity" ? "<span class='cat-score'><span data-cat='" + title + "'>0</span> / " + score + "</span>" : ""}</div>
  984. ${subtitle ? `<h3>${subtitle}</h3>` : ""}
  985. ${questions.map(child => this.createFieldset(child)).join("")}
  986. </div>`;
  987. };
  988. View.prototype.createResults = function () {
  989. return `<div class="card">
  990. <h2>Recommended Grade: <span class="grade">F</span></h2>
  991. <h2 class="totals">Total: (0/100)</h2>
  992. <div class="d-none" role="alert">
  993. You've selected <strong>True</strong> for one of more Academic
  994. Integrity prompts and are advised to investigate plagiarism before
  995. issuing a grade.
  996. </div>
  997. <div class="summary" aria-label="summary">
  998. ${this.model.categories
  999. .filter(category => category.title !== "Academic Integrity")
  1000. .map(category => {
  1001. let score = category.score;
  1002. let title = category.title;
  1003. let catClass = title.replace(/\s+/g, '-').toLowerCase();
  1004. return "<h2>" + title + "<span class='cat-score'><span data-res-cat='" + title + "'>0</span> / " + score + "</span></h2><pre class='" + catClass + "'>" + [...this.model.messages]
  1005. .filter(messageObj => messageObj.category === category.title)
  1006. .map(messageObj => `* ${messageObj.message}\n`)
  1007. .join("") + "</pre><button class='copy copy-" + catClass + "'>Copy To Clipboard</button>"
  1008. })
  1009. .join("")}
  1010. </div>
  1011. <div class="btn-container">
  1012. <button class="reset">Reset Form</button>
  1013. </div>
  1014. </div>`;
  1015. };
  1016. View.prototype.createHeader = function (title, isDarkMode = false) {
  1017. return `<header>
  1018. <h1>${title}</h1>
  1019. <div class="switch-group">
  1020. <input type="checkbox" name="dark-mode" id="dark-mode" ${
  1021. isDarkMode ? "checked" : ""
  1022. }>
  1023. <label aria-label="dark mode" for="dark-mode" class="toggle">
  1024. </label>
  1025. </div>
  1026. </header>`;
  1027. };
  1028. View.prototype.generateHTML = function () {
  1029. this.wrapper = document.querySelector("#app");
  1030. if (this.model.isDarkMode) {
  1031. this.wrapper.classList.add("dark");
  1032. }
  1033. const survey = this.model.categories.reduce((final, current) => {
  1034. final += this.createCard(current);
  1035. return final;
  1036. }, "");
  1037. const results = this.createResults();
  1038. const header = this.createHeader(
  1039. this.model.title,
  1040. this.model.isDarkMode
  1041. );
  1042. this.wrapper.innerHTML = header + survey + results;
  1043. };
  1044. View.prototype.update = function () {
  1045. const roundedScore = Math.min(100, Math.ceil(this.model.score));
  1046. this.totals.textContent = `Total: (${roundedScore}/ 100)`;
  1047. const letterGrade = this.model.calcGrade();
  1048. this.grade.textContent = letterGrade;
  1049. if (this.model.hasFlags()) {
  1050. this.alert.classList.remove("d-none");
  1051. } else {
  1052. this.alert.classList.add("d-none");
  1053. }
  1054. if (this.model.isDarkMode) {
  1055. this.wrapper.classList.add("dark");
  1056. } else {
  1057. this.wrapper.classList.remove("dark");
  1058. }
  1059. this.model.categories
  1060. .filter(category => category.title !== "Academic Integrity")
  1061. .forEach(category => {
  1062. let catClass = category.title.replace(/\s+/g, '-').toLowerCase();
  1063. this[catClass + "-summary"].innerHTML = [...this.model.messages]
  1064. .filter(messageObj => messageObj.category === category.title)
  1065. .map(messageObj => `* ${messageObj.message}\n`)
  1066. .join("")
  1067. })
  1068. };
  1069. function Controller(model, view) {
  1070. this.model = model;
  1071. this.view = view;
  1072. this.addEventListeners();
  1073. }
  1074. Controller.prototype.addEventListeners = function () {
  1075. this.view.wrapper.addEventListener("change", event => {
  1076. const { target } = event;
  1077. if (target.name !== "dark-mode") {
  1078. if (!target.matches("input[type='radio']")) {
  1079. this.model.handleSelect(target);
  1080. } else {
  1081. this.model.toggleRadio(target);
  1082. }
  1083. }
  1084. this.view.update();
  1085. });
  1086. this.view.resetButton.addEventListener("click", () => {
  1087. this.model.initStorage();
  1088. this.view.radios.forEach(
  1089. radio => (radio.checked = radio.hasAttribute("checked"))
  1090. );
  1091. this.view.selects.forEach(
  1092. select => select.selectedIndex = null
  1093. )
  1094. this.model.questions
  1095. .filter(question => question.category !== "Academic Integrity")
  1096. .forEach(question => {
  1097. const id = question.id;
  1098. const questionScore = document.querySelector("span[data-id='" + id + "']");
  1099. questionScore.textContent = 0;
  1100. });
  1101. this.model.categories
  1102. .filter(category => category.title !== "Academic Integrity")
  1103. .forEach(category => {
  1104. const title = category.title
  1105. const categoryScore = document.querySelector("span[data-cat='" + title + "']");
  1106. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + title + "']");
  1107. categoryScore.textContent = 0;
  1108. resultsCategoryScore.textContent = 0;
  1109. });
  1110. this.view.update();
  1111. window.scrollTo(0, 0);
  1112. });
  1113. this.model.categories
  1114. .filter(category => category.title !== "Academic Integrity")
  1115. .forEach(category => {
  1116. let title = category.title.replace(/\s+/g, '-').toLowerCase();
  1117. let buttonName = "copyButton-" + title;
  1118. let summaryName = title + "-summary";
  1119. this.view[buttonName].addEventListener("click", () => {
  1120. const selection = window.getSelection();
  1121. const range = document.createRange();
  1122. range.selectNodeContents(this.view[summaryName]);
  1123. selection.removeAllRanges();
  1124. selection.addRange(range);
  1125. document.execCommand("copy");
  1126. });
  1127. });
  1128. this.view.darkModeToggle.addEventListener("change", () => {
  1129. this.model.toggleDarkMode();
  1130. this.view.update();
  1131. });
  1132. };
  1133. function App(Model, View, Controller) {
  1134. this.model = new Model();
  1135. this.view = new View(this.model);
  1136. this.controller = new Controller(this.model, this.view);
  1137. }
  1138. return new App(Model, View, Controller);
  1139. })(window);
  1140. </script>
  1141. </body>
  1142. </html>