fe3.html 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296
  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 3 Bootstrap 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 3 Bootstrap 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 a Bootstrap Navbar",
  492. score: 6,
  493. type: "true false",
  494. message: "Application doesn't include a Bootstrap Navbar",
  495. status: false
  496. },
  497. {
  498. title:
  499. "Application includes a hero section with a photo or avatar of the student",
  500. score: 6,
  501. type: "true false",
  502. message: "Application doesn't include a hero section with 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: 6,
  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: 2
  542. },
  543. {
  544. message: "The application's navigation links to 2 of the 3 sections on the page",
  545. score: 4
  546. },
  547. {
  548. message: "The application's navigation links to each corresponding section on the page",
  549. score: 6
  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. "Application includes a footer section that includes hyperlinks with hover effects, and buttons with box shadows.",
  579. score: 6,
  580. type: "true false",
  581. message: "Application doesn't include a footer section that includes hyperlinks with hover effects, and buttons with box shadows.",
  582. status: false
  583. },
  584. {
  585. title:
  586. "The application adapts to the viewport with a responsive layout by resizing the page on various screens and devices using Bootstrap's Grid",
  587. score: 6,
  588. type: "true false",
  589. message: "The application doesn't adapt to the viewport with a responsive layout by resizing the page on various screens and devices using Bootstrap's Grid",
  590. status: false
  591. },
  592. ]
  593. },
  594. {
  595. title: "Repository Quality",
  596. subtitle: null,
  597. score: 0,
  598. questions: [
  599. {
  600. title: "Repository has a unique name",
  601. score: 2,
  602. type: "true false",
  603. message: "Repo doesn't have a unique name",
  604. status: false
  605. },
  606. {
  607. title:
  608. "Repository follows best practices for file structure and naming conventions",
  609. score: 2,
  610. type: "true false",
  611. message:
  612. "Code doesn't follow recommended file/folder structure",
  613. status: false
  614. },
  615. {
  616. title:
  617. "Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.",
  618. score: 2,
  619. type: "true false",
  620. message:
  621. "Code doesn't follow good practices for class/id names, indentation, lacks quality comments",
  622. status: false
  623. },
  624. {
  625. title:
  626. "Repository contains multiple descriptive commit messages",
  627. score: 2,
  628. type: "true false",
  629. message:
  630. "Repo doesn't contain multiple descriptive commit messages",
  631. status: false
  632. },
  633. {
  634. title: "Repository contains quality README with description, screenshot, link to deployed application",
  635. score: 5,
  636. type: "likert",
  637. options: [
  638. {
  639. message: "Repo doesn't include a high quality README with screenshots, a description, link to deployed application",
  640. score: 0
  641. },
  642. {
  643. message: "Repository README is missing 2 of the following: description, screenshot, or link to deployed application",
  644. score: 2
  645. },
  646. {
  647. message: "Repository README is missing 1 of the following: description, screenshot, or link to deployed application",
  648. score: 4
  649. },
  650. {
  651. message: "Repository contains quality README with description, screenshot, link to deployed application",
  652. score: 5
  653. }
  654. ],
  655. message: "",
  656. status: false
  657. }
  658. ]
  659. },
  660. {
  661. title: "Application Quality",
  662. subtitle: null,
  663. score: 0,
  664. questions: [
  665. {
  666. title: "Application resembles the functionality of their previous portfolio",
  667. score: 15,
  668. type: "likert",
  669. options: [
  670. {
  671. message: "Application does not resemble the functionality of their previous portfolio",
  672. score: 0
  673. },
  674. {
  675. message: "Application could resemble the functionality of their previous portfolio a lot more closely",
  676. score: 5
  677. },
  678. {
  679. message: "Application could resemble the functionality of their previous portfolio a bit more closely",
  680. score: 10
  681. },
  682. {
  683. message: "Application resembles the functionality of their previous portfolio",
  684. score: 15
  685. }
  686. ],
  687. message: "",
  688. status: false
  689. }
  690. ]
  691. },
  692. {
  693. title: "Academic Integrity",
  694. subtitle:
  695. "If any of of the following are true, partner with your instructor to investigate plagiarism. Contact your SSM if you believe plagiarism has occurred.",
  696. score: 0,
  697. questions: [
  698. {
  699. title: "Application contains a low number of commits",
  700. score: 0,
  701. type: "true false",
  702. message: null,
  703. status: false
  704. },
  705. {
  706. title:
  707. "Application codebase appears advanced for the student, at this point in the course, or in general",
  708. score: 0,
  709. type: "true false",
  710. message: null,
  711. status: false
  712. },
  713. {
  714. title:
  715. "Application package.json file references a different author and/or repository",
  716. score: 0,
  717. type: "true false",
  718. message: null,
  719. status: false
  720. },
  721. {
  722. title:
  723. "Application package.json file references much older versions of npm packages",
  724. score: 0,
  725. type: "true false",
  726. message: null,
  727. status: false
  728. }
  729. ]
  730. }
  731. ];
  732. this.initStorage();
  733. }
  734. Model.prototype.initStorage = function () {
  735. this.score = 0;
  736. this.questions = [];
  737. this.messages = new Set();
  738. this.flagged = new Set();
  739. this.isDarkMode =
  740. JSON.parse(localStorage.getItem("isDarkMode")) || false;
  741. this.categories
  742. .forEach(category => {
  743. category.score = 0;
  744. category.questions.forEach(question => {
  745. question.category = category.title;
  746. question.status = false;
  747. question.id = this.questions.length;
  748. question.flagged = category.title === "Academic Integrity";
  749. question.bonus = category.title === "Bonus";
  750. if (question.type === "likert") {
  751. question.message = question.options[0].message.split(" - ").pop();
  752. };
  753. let messageObj = {
  754. message: question.message,
  755. category: question.category
  756. };
  757. question.message && !question.bonus && this.messages.add(messageObj);
  758. this.questions.push(question);
  759. category.score += question.score;
  760. });
  761. });
  762. };
  763. Model.prototype.toggleDarkMode = function () {
  764. this.isDarkMode = !this.isDarkMode;
  765. localStorage.setItem("isDarkMode", this.isDarkMode);
  766. };
  767. Model.prototype.toggleRadio = function (radio) {
  768. const id = Number(radio.getAttribute("name"));
  769. const question = this.questions[id];
  770. const questionScore = document.querySelector("span[data-id='" + id + "']");
  771. const category = question.category;
  772. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  773. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  774. question.status = !question.status;
  775. if (question.status === true) {
  776. if (!question.bonus) {
  777. this.messages.forEach(message => {
  778. if (message.message === question.message) {
  779. this.messages.delete(message);
  780. }
  781. })
  782. } else {
  783. let messageObj = {
  784. message: question.message,
  785. category: category
  786. }
  787. this.messages.add(messageObj);
  788. }
  789. this.score += question.score;
  790. if (question.flagged) {
  791. this.flagged.add(question.id);
  792. }
  793. } else {
  794. if (question.flagged) {
  795. this.flagged.delete(question.id);
  796. }
  797. if (!question.bonus) {
  798. if (question.message) {
  799. let messageObj = {
  800. message: question.message,
  801. category: category
  802. }
  803. this.messages.add(messageObj);
  804. }
  805. } else {
  806. this.messages.forEach(message => {
  807. if (message.message === question.message) {
  808. this.messages.delete(message);
  809. }
  810. })
  811. }
  812. this.score -= question.score;
  813. }
  814. if (category !== "Academic Integrity") {
  815. if (question.status) {
  816. questionScore.textContent = question.score;
  817. } else {
  818. questionScore.textContent = 0;
  819. }
  820. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  821. let categoryTotal = 0;
  822. catQuestions.forEach(question => {
  823. if (question.type === "true false") {
  824. if (question.status) {
  825. categoryTotal += question.score;
  826. }
  827. } else {
  828. let score = document.querySelector("select[name='" + question.id + "']").value;
  829. categoryTotal += parseInt(score);
  830. }
  831. })
  832. categoryScore.textContent = categoryTotal;
  833. resultsCategoryScore.textContent = categoryTotal;
  834. }
  835. };
  836. Model.prototype.handleSelect = function (select) {
  837. const id = Number(select.getAttribute("name"));
  838. const question = this.questions[id];
  839. const questionScore = document.querySelector("span[data-id='" + id + "']");
  840. const oldScore = questionScore.textContent;
  841. const category = question.category;
  842. const categoryScore = document.querySelector("span[data-cat='" + category + "']");
  843. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + category + "']");
  844. let newMessage = select.selectedOptions[0].text.split(" - ").pop();
  845. if (newMessage === "Open this menu") {
  846. newMessage = select[1].text.split(" - ").pop();
  847. };
  848. if (question.type === "likert") {
  849. this.messages.forEach(item => {
  850. if (item.message === question.message) {
  851. this.messages.delete(item)
  852. }
  853. })
  854. question.message = newMessage;
  855. let messageObj = {
  856. message: newMessage,
  857. category: category
  858. }
  859. this.messages.add(messageObj);
  860. };
  861. this.score -= parseInt(oldScore);
  862. this.score += parseInt(select.value);
  863. questionScore.textContent = select.value;
  864. const catQuestions = this.categories.filter(cat => cat.title === category)[0].questions;
  865. let categoryTotal = 0;
  866. catQuestions.forEach(question => {
  867. if (question.type === "true false") {
  868. if (question.status) {
  869. categoryTotal += question.score;
  870. }
  871. } else {
  872. let score = document.querySelector("select[name='" + question.id + "']").value;
  873. categoryTotal += parseInt(score);
  874. }
  875. })
  876. categoryScore.textContent = categoryTotal;
  877. resultsCategoryScore.textContent = categoryTotal;
  878. };
  879. Model.prototype.calcGrade = function () {
  880. const roundedScore = Math.min(100, Math.ceil(this.score));
  881. let letterGrade = "";
  882. if (roundedScore >= 97) {
  883. letterGrade = "A+";
  884. } else if (roundedScore >= 93 && roundedScore <= 96) {
  885. letterGrade = "A";
  886. } else if (roundedScore >= 90 && roundedScore <= 92) {
  887. letterGrade = "A-";
  888. } else if (roundedScore >= 87 && roundedScore <= 89) {
  889. letterGrade = "B+";
  890. } else if (roundedScore >= 83 && roundedScore <= 86) {
  891. letterGrade = "B";
  892. } else if (roundedScore >= 80 && roundedScore <= 82) {
  893. letterGrade = "B-";
  894. } else if (roundedScore >= 77 && roundedScore <= 79) {
  895. letterGrade = "C+";
  896. } else if (roundedScore >= 73 && roundedScore <= 76) {
  897. letterGrade = "C";
  898. } else if (roundedScore >= 70 && roundedScore <= 72) {
  899. letterGrade = "C-";
  900. } else if (roundedScore >= 67 && roundedScore <= 69) {
  901. letterGrade = "D+";
  902. } else if (roundedScore >= 63 && roundedScore <= 66) {
  903. letterGrade = "D";
  904. } else if (roundedScore >= 60 && roundedScore <= 62) {
  905. letterGrade = "D-";
  906. } else {
  907. letterGrade = "F";
  908. }
  909. return letterGrade;
  910. };
  911. Model.prototype.hasFlags = function () {
  912. return this.flagged.size > 0;
  913. };
  914. function View(model) {
  915. this.model = model;
  916. this.generateHTML();
  917. this.cacheDom();
  918. }
  919. View.prototype.cacheDom = function () {
  920. this.darkModeToggle = document.querySelector("#dark-mode");
  921. this.radios = Array.from(
  922. document.querySelectorAll("input[type='radio']")
  923. );
  924. this.selects = Array.from(
  925. document.querySelectorAll("select")
  926. );
  927. this.totals = document.querySelector(".totals");
  928. this.grade = document.querySelector(".grade");
  929. this.alert = document.querySelector("div[role='alert']");
  930. this.summaryHeading = document.querySelector(".summary-heading");
  931. this.summary = document.querySelector(".summary");
  932. this.model.categories
  933. .filter(category => category.title !== "Academic Integrity")
  934. .map(category => {
  935. let summary = category.title.replace(/\s+/g, '-').toLowerCase();
  936. let summaryName = summary + "-summary";
  937. return this[summaryName] = document.querySelector("." + summary);
  938. })
  939. this.resetButton = document.querySelector(".reset");
  940. this.model.categories
  941. .filter(category => category.title !== "Academic Integrity")
  942. .map(category => {
  943. let button = category.title.replace(/\s+/g, '-').toLowerCase();
  944. let buttonName = "copyButton-" + button;
  945. return this[buttonName] = document.querySelector(".copy-" + button);
  946. })
  947. };
  948. View.prototype.createFieldset = function ({ title, id, score, status, category, type, options }) {
  949. return `<fieldset class="input-group">
  950. <legend>
  951. <span class="title">${title}</span> ${category === "Academic Integrity" ? "" : "<span class='score'><span data-id='" + id + "' class='current-score'>0</span> / " + score + "</span>"}
  952. </legend>
  953. ${type === "true false" ?
  954. `<div class="radio-group">
  955. <input type="radio" name="${id}" id="${id}-true" value="true">
  956. <label for="${id}-true">True</label>
  957. </div>
  958. <div class="radio-group">
  959. <input type="radio" name="${id}" id="${id}-false" value="false" checked>
  960. <label for="${id}-false">False</label>
  961. </div>` :
  962. `<div class="select-group">
  963. <select name="${id}" class="select-lg select2 narrow wrap">
  964. <option value="0" selected>Open this menu</option>
  965. ${options.map(option => `<option value="${option.score}">${option.score} - ${option.message}</option>`)}
  966. </select>
  967. </div>`
  968. }
  969. </fieldset>`;
  970. };
  971. View.prototype.createCard = function ({ title, subtitle, questions, score }) {
  972. return `<div class="card">
  973. <div class="card-header"><h2>${title}</h2> ${title !== "Academic Integrity" ? "<span class='cat-score'><span data-cat='" + title + "'>0</span> / " + score + "</span>" : ""}</div>
  974. ${subtitle ? `<h3>${subtitle}</h3>` : ""}
  975. ${questions.map(child => this.createFieldset(child)).join("")}
  976. </div>`;
  977. };
  978. View.prototype.createResults = function () {
  979. return `<div class="card">
  980. <h2>Recommended Grade: <span class="grade">F</span></h2>
  981. <h2 class="totals">Total: (0/100)</h2>
  982. <div class="d-none" role="alert">
  983. You've selected <strong>True</strong> for one of more Academic
  984. Integrity prompts and are advised to investigate plagiarism before
  985. issuing a grade.
  986. </div>
  987. <div class="summary" aria-label="summary">
  988. ${this.model.categories
  989. .filter(category => category.title !== "Academic Integrity")
  990. .map(category => {
  991. let score = category.score;
  992. let title = category.title;
  993. let catClass = title.replace(/\s+/g, '-').toLowerCase();
  994. return "<h2>" + title + "<span class='cat-score'><span data-res-cat='" + title + "'>0</span> / " + score + "</span></h2><pre class='" + catClass + "'>" + [...this.model.messages]
  995. .filter(messageObj => messageObj.category === category.title)
  996. .map(messageObj => `* ${messageObj.message}\n`)
  997. .join("") + "</pre><button class='copy copy-" + catClass + "'>Copy To Clipboard</button>"
  998. })
  999. .join("")}
  1000. </div>
  1001. <div class="btn-container">
  1002. <button class="reset">Reset Form</button>
  1003. </div>
  1004. </div>`;
  1005. };
  1006. View.prototype.createHeader = function (title, isDarkMode = false) {
  1007. return `<header>
  1008. <h1>${title}</h1>
  1009. <div class="switch-group">
  1010. <input type="checkbox" name="dark-mode" id="dark-mode" ${
  1011. isDarkMode ? "checked" : ""
  1012. }>
  1013. <label aria-label="dark mode" for="dark-mode" class="toggle">
  1014. </label>
  1015. </div>
  1016. </header>`;
  1017. };
  1018. View.prototype.generateHTML = function () {
  1019. this.wrapper = document.querySelector("#app");
  1020. if (this.model.isDarkMode) {
  1021. this.wrapper.classList.add("dark");
  1022. }
  1023. const survey = this.model.categories.reduce((final, current) => {
  1024. final += this.createCard(current);
  1025. return final;
  1026. }, "");
  1027. const results = this.createResults();
  1028. const header = this.createHeader(
  1029. this.model.title,
  1030. this.model.isDarkMode
  1031. );
  1032. this.wrapper.innerHTML = header + survey + results;
  1033. };
  1034. View.prototype.update = function () {
  1035. const roundedScore = Math.min(100, Math.ceil(this.model.score));
  1036. this.totals.textContent = `Total: (${roundedScore}/ 100)`;
  1037. const letterGrade = this.model.calcGrade();
  1038. this.grade.textContent = letterGrade;
  1039. if (this.model.hasFlags()) {
  1040. this.alert.classList.remove("d-none");
  1041. } else {
  1042. this.alert.classList.add("d-none");
  1043. }
  1044. if (this.model.isDarkMode) {
  1045. this.wrapper.classList.add("dark");
  1046. } else {
  1047. this.wrapper.classList.remove("dark");
  1048. }
  1049. this.model.categories
  1050. .filter(category => category.title !== "Academic Integrity")
  1051. .forEach(category => {
  1052. let catClass = category.title.replace(/\s+/g, '-').toLowerCase();
  1053. this[catClass + "-summary"].innerHTML = [...this.model.messages]
  1054. .filter(messageObj => messageObj.category === category.title)
  1055. .map(messageObj => `* ${messageObj.message}\n`)
  1056. .join("")
  1057. })
  1058. };
  1059. function Controller(model, view) {
  1060. this.model = model;
  1061. this.view = view;
  1062. this.addEventListeners();
  1063. }
  1064. Controller.prototype.addEventListeners = function () {
  1065. this.view.wrapper.addEventListener("change", event => {
  1066. const { target } = event;
  1067. if (target.name !== "dark-mode") {
  1068. if (!target.matches("input[type='radio']")) {
  1069. this.model.handleSelect(target);
  1070. } else {
  1071. this.model.toggleRadio(target);
  1072. }
  1073. }
  1074. this.view.update();
  1075. });
  1076. this.view.resetButton.addEventListener("click", () => {
  1077. this.model.initStorage();
  1078. this.view.radios.forEach(
  1079. radio => (radio.checked = radio.hasAttribute("checked"))
  1080. );
  1081. this.view.selects.forEach(
  1082. select => select.selectedIndex = null
  1083. )
  1084. this.model.questions
  1085. .filter(question => question.category !== "Academic Integrity")
  1086. .forEach(question => {
  1087. const id = question.id;
  1088. const questionScore = document.querySelector("span[data-id='" + id + "']");
  1089. questionScore.textContent = 0;
  1090. });
  1091. this.model.categories
  1092. .filter(category => category.title !== "Academic Integrity")
  1093. .forEach(category => {
  1094. const title = category.title
  1095. const categoryScore = document.querySelector("span[data-cat='" + title + "']");
  1096. const resultsCategoryScore = document.querySelector("span[data-res-cat='" + title + "']");
  1097. categoryScore.textContent = 0;
  1098. resultsCategoryScore.textContent = 0;
  1099. });
  1100. this.view.update();
  1101. window.scrollTo(0, 0);
  1102. });
  1103. this.model.categories
  1104. .filter(category => category.title !== "Academic Integrity")
  1105. .forEach(category => {
  1106. let title = category.title.replace(/\s+/g, '-').toLowerCase();
  1107. let buttonName = "copyButton-" + title;
  1108. let summaryName = title + "-summary";
  1109. this.view[buttonName].addEventListener("click", () => {
  1110. const selection = window.getSelection();
  1111. const range = document.createRange();
  1112. range.selectNodeContents(this.view[summaryName]);
  1113. selection.removeAllRanges();
  1114. selection.addRange(range);
  1115. document.execCommand("copy");
  1116. });
  1117. });
  1118. this.view.darkModeToggle.addEventListener("change", () => {
  1119. this.model.toggleDarkMode();
  1120. this.view.update();
  1121. });
  1122. };
  1123. function App(Model, View, Controller) {
  1124. this.model = new Model();
  1125. this.view = new View(this.model);
  1126. this.controller = new Controller(this.model, this.view);
  1127. }
  1128. return new App(Model, View, Controller);
  1129. })(window);
  1130. </script>
  1131. </body>
  1132. </html>