feat: grade exercise with AI (#296)

* working on the UI of the grading

* working on the grading function of the radio and checkboxes

* ai grading fully implemented with dummy functions for generating scores

* working on the openai response

* working on the openai response

* finished with the ai_grading

* finished with the ai_grading

* creating new migration file

* working on reviews

* updated the translations

* improvements

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Em_Dev
2024-05-13 19:35:06 +01:00
committed by GitHub
co-authored by Rotimi Best
parent fc8b8e1898
commit e243564113
37 changed files with 688 additions and 150 deletions
+6
View File
@@ -0,0 +1,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.1602" cy="9.43977" r="9.17119" transform="rotate(1.6909 10.1602 9.43977)" fill="#0233BD"/>
<path d="M11.3852 5.35419C11.4728 5.03967 11.9232 5.05297 11.9921 5.3721L12.6384 8.36772C12.6629 8.48123 12.7483 8.57182 12.8602 8.60297L15.8125 9.42493C16.127 9.51249 16.1137 9.96289 15.7945 10.0317L12.7989 10.6781C12.6854 10.7026 12.5948 10.788 12.5637 10.8999L11.7417 13.8522C11.6542 14.1667 11.2038 14.1534 11.1349 13.8342L10.4885 10.8386C10.464 10.7251 10.3786 10.6345 10.2668 10.6034L7.31449 9.78141C6.99998 9.69385 7.01328 9.24345 7.33241 9.17459L10.328 8.52822C10.4415 8.50372 10.5321 8.41833 10.5633 8.30646L11.3852 5.35419Z" fill="white"/>
<path d="M5.91584 5.19179C6.00341 4.87727 6.4538 4.89057 6.52266 5.2097L6.70599 6.05932C6.73048 6.17284 6.81588 6.26343 6.92775 6.29458L7.76508 6.5277C8.0796 6.61527 8.0663 7.06566 7.74717 7.13452L6.89754 7.31785C6.78403 7.34234 6.69344 7.42774 6.66229 7.53961L6.42916 8.37694C6.3416 8.69146 5.8912 8.67816 5.82234 8.35903L5.63902 7.50941C5.61452 7.39589 5.52913 7.3053 5.41726 7.27415L4.57992 7.04103C4.26541 6.95346 4.27871 6.50307 4.59784 6.43421L5.44746 6.25088C5.56098 6.22639 5.65157 6.14099 5.68272 6.02912L5.91584 5.19179Z" fill="white"/>
<path d="M5.74983 10.8148C5.83739 10.5003 6.28779 10.5136 6.35665 10.8327L6.53997 11.6824C6.56447 11.7959 6.64986 11.8865 6.76174 11.9176L7.59907 12.1508C7.91358 12.2383 7.90028 12.6887 7.58115 12.7576L6.73153 12.9409C6.61801 12.9654 6.52742 13.0508 6.49627 13.1627L6.26315 14C6.17558 14.3145 5.72519 14.3012 5.65633 13.9821L5.473 13.1325C5.44851 13.0189 5.36311 12.9283 5.25124 12.8972L4.41391 12.6641C4.0994 12.5765 4.11269 12.1261 4.43182 12.0573L5.28145 11.8739C5.39496 11.8494 5.48555 11.764 5.5167 11.6522L5.74983 10.8148Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

+37
View File
@@ -0,0 +1,37 @@
<svg width="82" height="106" viewBox="0 0 82 106" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_dddd_5412_25762)">
<rect x="13" y="4" width="56" height="56" rx="28" fill="#0F62FE"/>
<g clip-path="url(#clip0_5412_25762)">
<path d="M41 15.1562C30.3674 15.1562 21.75 22.1569 21.75 30.7969C21.75 34.5266 23.3592 37.9404 26.0361 40.6249C25.0962 44.4147 21.953 47.791 21.9154 47.8286C21.75 48.0016 21.7049 48.2572 21.8026 48.4828C21.9004 48.7084 22.1109 48.8438 22.3516 48.8438C27.337 48.8438 31.0742 46.4525 32.924 44.9787C35.3829 45.9036 38.1125 46.4375 41 46.4375C51.6326 46.4375 60.25 39.4368 60.25 30.7969C60.25 22.1569 51.6326 15.1562 41 15.1562ZM31.375 33.2031C30.044 33.2031 28.9687 32.1278 28.9687 30.7969C28.9687 29.4659 30.044 28.3906 31.375 28.3906C32.706 28.3906 33.7812 29.4659 33.7812 30.7969C33.7812 32.1278 32.706 33.2031 31.375 33.2031ZM41 33.2031C39.669 33.2031 38.5938 32.1278 38.5938 30.7969C38.5938 29.4659 39.669 28.3906 41 28.3906C42.331 28.3906 43.4062 29.4659 43.4062 30.7969C43.4062 32.1278 42.331 33.2031 41 33.2031ZM50.625 33.2031C49.294 33.2031 48.2188 32.1278 48.2188 30.7969C48.2188 29.4659 49.294 28.3906 50.625 28.3906C51.956 28.3906 53.0312 29.4659 53.0312 30.7969C53.0312 32.1278 51.956 33.2031 50.625 33.2031Z" fill="#F5F8FE"/>
</g>
</g>
<defs>
<filter id="filter0_dddd_5412_25762" x="0.555554" y="0.888889" width="80.8889" height="104.222" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1.55556"/>
<feGaussianBlur stdDeviation="2.33333"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0156863 0 0 0 0 0.501961 0 0 0 0.2 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5412_25762"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="7.77778"/>
<feGaussianBlur stdDeviation="3.88889"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0156863 0 0 0 0 0.501961 0 0 0 0.17 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_5412_25762" result="effect2_dropShadow_5412_25762"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="18.6667"/>
<feGaussianBlur stdDeviation="5.44445"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0156863 0 0 0 0 0.501961 0 0 0 0.1 0"/>
<feBlend mode="normal" in2="effect2_dropShadow_5412_25762" result="effect3_dropShadow_5412_25762"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="32.6667"/>
<feGaussianBlur stdDeviation="6.22222"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.0156863 0 0 0 0 0.501961 0 0 0 0.03 0"/>
<feBlend mode="normal" in2="effect3_dropShadow_5412_25762" result="effect4_dropShadow_5412_25762"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect4_dropShadow_5412_25762" result="shape"/>
</filter>
<clipPath id="clip0_5412_25762">
<rect width="38.5" height="38.5" fill="white" transform="translate(21.75 12.75)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB