fsf17.html 53 KB

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