userManagement, startExam api | 365

main
alireza khaji 2 years ago
parent bf4aef4e90
commit 98b14196a4
  1. 2
      public/icons/table/ReactTable4arrow-icon.svg
  2. 4
      public/icons/table/ReactTable4double-left-arrow copy.svg
  3. 4
      public/icons/table/ReactTable4double-left-arrow.svg
  4. 4
      public/icons/table/ReactTable4edit.svg
  5. 2
      public/icons/table/ReactTable4filter.svg
  6. 2
      public/icons/table/ReactTable4left-arrow.svg
  7. 2
      public/icons/table/ReactTable4right-arrow.svg
  8. 4
      public/icons/table/ReactTable4search-normal copy.svg
  9. 4
      public/icons/table/ReactTable4search-normal.svg
  10. 4
      public/icons/table/ReactTable4settings.svg
  11. 4
      public/icons/table/ReactTable4zarbedar-icon copy.svg
  12. 4
      public/icons/table/ReactTable4zarbedar-icon.svg
  13. 4
      public/icons/table/ReactTable5zarbedar-icon.svg
  14. 22
      src/App.js
  15. 4
      src/components/Product/index.js
  16. 11
      src/components/ShoppingCart/index.js
  17. 4
      src/components/Table/Layouts/Footer/components/ShowMoreRows.js
  18. 10
      src/components/Table/Layouts/Main/components/Table.js
  19. 2
      src/components/Table/Layouts/Toolbar/components/GoToPage.js
  20. 2
      src/components/Table/Layouts/Toolbar/components/Tabbar.js
  21. 2
      src/components/Table/Layouts/Toolbar/index.js
  22. 2
      src/components/Table/components/ColumnSearch.js
  23. 8
      src/components/Table/components/Columns/components/Buttons.js
  24. 2
      src/components/Table/components/Columns/components/EditButtons.js
  25. 10
      src/components/Table/components/Columns/index.js
  26. 2
      src/components/Table/index.js
  27. 63
      src/components/header/Header.js
  28. 8
      src/constants/defaultValues.js
  29. 4
      src/redux/actions/exam.js
  30. 2
      src/redux/proxy.js
  31. 14
      src/redux/reducers/book.js
  32. 5
      src/redux/reducers/exam2.js
  33. 104
      src/view/Exam/EnterExam/desktop/index.js
  34. 10
      src/view/Exam/EnterExam/index.js
  35. 20
      src/view/Exam/index.js
  36. 19
      src/view/Exam2/Exam.js
  37. 322
      src/view/Exam2/Questions.js
  38. 28
      src/view/addExam/views/ViewExamNote.js
  39. 12
      src/view/services/Budget.js
  40. 4
      src/view/services/PaymentBox.js
  41. 28
      src/view/services/service/index.js
  42. 10
      src/view/user-management/index.js
  43. 2
      src/view/user-management/layouts/Editor.js

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
<g id="arrow-down" transform="translate(0)"> <g id="arrow-down" transform="translate(0)">
<path id="Vector" d="M9.9,0,5.825,4.075a1.241,1.241,0,0,1-1.75,0L0,0" transform="translate(2.55 5.594)" fill="none" stroke="rgba(0,37,58,0.32)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/> <path id="Vector" d="M9.9,0,5.825,4.075a1.241,1.241,0,0,1-1.75,0L0,0" transform="translate(2.55 5.594)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0H15V15H0Z" transform="translate(15 15) rotate(180)" fill="none" opacity="0"/> <path id="Vector-2" data-name="Vector" d="M0,0H15V15H0Z" transform="translate(15 15) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 478 B

@ -1,11 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988"> <svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)"> <g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)">
<g id="arrow-right" transform="translate(4)"> <g id="arrow-right" transform="translate(4)">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
<g id="arrow-right-2" data-name="arrow-right"> <g id="arrow-right-2" data-name="arrow-right">
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,11 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988"> <svg xmlns="http://www.w3.org/2000/svg" width="15.988" height="11.988" viewBox="0 0 15.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)"> <g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(15.988 11.988) rotate(180)">
<g id="arrow-right" transform="translate(4)"> <g id="arrow-right" transform="translate(4)">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
<g id="arrow-right-2" data-name="arrow-right"> <g id="arrow-right-2" data-name="arrow-right">
<path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector-3" data-name="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-4" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</g> </g>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16.715" height="16.703" viewBox="0 0 16.715 16.703"> <svg xmlns="http://www.w3.org/2000/svg" width="16.715" height="16.703" viewBox="0 0 16.715 16.703">
<g id="edit" transform="translate(-626.295 -252.999)"> <g id="edit" transform="translate(-626.295 -252.999)">
<path id="Vector" d="M8.991,1.271l-7.88,7.88a2.712,2.712,0,0,0-.66,1.32l-.43,3.01a1.424,1.424,0,0,0,1.7,1.7l3.01-.43a2.8,2.8,0,0,0,1.32-.66l7.88-7.88c1.36-1.36,2-2.94,0-4.94S10.351-.089,8.991,1.271Z" transform="translate(627.049 253.749)" fill="none" stroke="#00253a" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/> <path id="Vector" d="M8.991,1.271l-7.88,7.88a2.712,2.712,0,0,0-.66,1.32l-.43,3.01a1.424,1.424,0,0,0,1.7,1.7l3.01-.43a2.8,2.8,0,0,0,1.32-.66l7.88-7.88c1.36-1.36,2-2.94,0-4.94S10.351-.089,8.991,1.271Z" transform="translate(627.049 253.749)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
<path id="Vector-2" data-name="Vector" d="M0,0A7.144,7.144,0,0,0,4.94,4.94" transform="translate(634.91 256.15)" fill="none" stroke="#00253a" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/> <path id="Vector-2" data-name="Vector" d="M0,0A7.144,7.144,0,0,0,4.94,4.94" transform="translate(634.91 256.15)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 725 B

@ -1,3 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="19.631" height="22.407" viewBox="0 0 19.631 22.407"> <svg xmlns="http://www.w3.org/2000/svg" width="19.631" height="22.407" viewBox="0 0 19.631 22.407">
<path id="Vector" d="M2.105,0h13.92a2.107,2.107,0,0,1,2.105,2.105V4.428A3.933,3.933,0,0,1,17.078,6.86L13.613,9.924l-1.072.947A3.417,3.417,0,0,0,11.488,13.3v4.537a2.367,2.367,0,0,1-.944,1.8l-1.47.926a2.145,2.145,0,0,1-3.267-1.8v-5.59a3.962,3.962,0,0,0-.853-2.214L.944,6.733A3.43,3.43,0,0,1,0,4.628V2.214A2.133,2.133,0,0,1,2.105,0Z" transform="translate(0.75 0.75)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/> <path id="Vector" d="M2.105,0h13.92a2.107,2.107,0,0,1,2.105,2.105V4.428A3.933,3.933,0,0,1,17.078,6.86L13.613,9.924l-1.072.947A3.417,3.417,0,0,0,11.488,13.3v4.537a2.367,2.367,0,0,1-.944,1.8l-1.47.926a2.145,2.145,0,0,1-3.267-1.8v-5.59a3.962,3.962,0,0,0-.853-2.214L.944,6.733A3.43,3.43,0,0,1,0,4.628V2.214A2.133,2.133,0,0,1,2.105,0Z" transform="translate(0.75 0.75)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988"> <svg xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988">
<g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(11.988 11.988) rotate(180)"> <g id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" transform="translate(11.988 11.988) rotate(180)">
<g id="arrow-right"> <g id="arrow-right">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</g> </g>

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 622 B

@ -1,6 +1,6 @@
<svg id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988"> <svg id="vuesax_linear_arrow-right" data-name="vuesax/linear/arrow-right" xmlns="http://www.w3.org/2000/svg" width="11.988" height="11.988" viewBox="0 0 11.988 11.988">
<g id="arrow-right"> <g id="arrow-right">
<path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> <path id="Vector" d="M0,7.912,3.257,4.655a.992.992,0,0,0,0-1.4L0,0" transform="translate(4.451 2.038)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/> <path id="Vector-2" data-name="Vector" d="M0,0H11.988V11.988H0Z" transform="translate(11.988 11.988) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

@ -2,9 +2,9 @@
<g id="search-normal" transform="translate(-428 -188)"> <g id="search-normal" transform="translate(-428 -188)">
<g id="Vector" transform="translate(430 190)" fill="none"> <g id="Vector" transform="translate(430 190)" fill="none">
<path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/> <path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#65a9ff"/> <path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#a51c45"/>
</g> </g>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#65a9ff"/> <path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#a51c45"/>
<path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/> <path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -2,9 +2,9 @@
<g id="search-normal" transform="translate(-428 -188)"> <g id="search-normal" transform="translate(-428 -188)">
<g id="Vector" transform="translate(430 190)" fill="none"> <g id="Vector" transform="translate(430 190)" fill="none">
<path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/> <path d="M19,9.5A9.5,9.5,0,1,1,9.5,0,9.5,9.5,0,0,1,19,9.5Z" stroke="none"/>
<path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#65a9ff"/> <path d="M 9.5 1.5 C 5.088789939880371 1.5 1.5 5.088789939880371 1.5 9.5 C 1.5 13.91121006011963 5.088789939880371 17.5 9.5 17.5 C 13.91121006011963 17.5 17.5 13.91121006011963 17.5 9.5 C 17.5 5.088789939880371 13.91121006011963 1.5 9.5 1.5 M 9.5 0 C 14.74670028686523 0 19 4.253290176391602 19 9.5 C 19 14.74670028686523 14.74670028686523 19 9.5 19 C 4.253290176391602 19 0 14.74670028686523 0 9.5 C 0 4.253290176391602 4.253290176391602 0 9.5 0 Z" stroke="none" fill="#a51c45"/>
</g> </g>
<path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#65a9ff"/> <path id="Vector-2" data-name="Vector" d="M2.552,3.252a.7.7,0,0,1-.49-.2L.2,1.192A.706.706,0,0,1,.2.2a.706.706,0,0,1,.99,0l1.86,1.86a.706.706,0,0,1,0,.99A.738.738,0,0,1,2.552,3.252Z" transform="translate(446.747 206.747)" fill="#a51c45"/>
<path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/> <path id="Vector-3" data-name="Vector" d="M0,0H24V24H0Z" transform="translate(452 212) rotate(180)" fill="none" opacity="0"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397"> <svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)"> <g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397"> <svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)"> <g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397"> <svg xmlns="http://www.w3.org/2000/svg" width="5.397" height="5.397" viewBox="0 0 5.397 5.397">
<g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)"> <g id="Group_1887" data-name="Group 1887" transform="translate(0.707 0.707)">
<path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector" d="M3.943,3.943,0,0" transform="translate(0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
<path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#65a9ff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> <path id="Vector-2" data-name="Vector" d="M3.943,0,0,3.943" transform="translate(0 0.04)" fill="none" stroke="#a51c45" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

@ -629,10 +629,14 @@ let data = [
function App() { function App() {
let location = window.location.pathname; let location = window.location.pathname;
const [dontShowNav,setDontShowNav]=useState(false);
useEffect(()=>{
location = window.location.pathname;
})
// const {id} = useParams(); // const {id} = useParams();
console.log(location); console.log(location);
let buyPackagesData = null; let buyPackagesData = null;
if (location.includes("buy-packages")) { if (location?.includes("buy-packages")) {
let pathList = location.split("/"); let pathList = location.split("/");
let id = pathList[pathList.length - 1]; let id = pathList[pathList.length - 1];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
@ -644,8 +648,6 @@ function App() {
} }
let loginStorage = localStorage.getItem("userData"); let loginStorage = localStorage.getItem("userData");
let userData = JSON.parse(loginStorage); let userData = JSON.parse(loginStorage);
console.log(loginStorage == null);
console.log(userData);
const [LOGIN, setLOGIN] = useState(loginStorage == undefined ? false : true); const [LOGIN, setLOGIN] = useState(loginStorage == undefined ? false : true);
const activeLogin = () => { const activeLogin = () => {
setLOGIN(true); setLOGIN(true);
@ -669,7 +671,6 @@ function App() {
const [ActiveUserFullInfo, setActiveUserFullInfo] = useState(false); const [ActiveUserFullInfo, setActiveUserFullInfo] = useState(false);
const [UserFullInfoData, setUserFullInfoData] = useState(buyPackagesData); const [UserFullInfoData, setUserFullInfoData] = useState(buyPackagesData);
const showUserFullInfo = (data) => { const showUserFullInfo = (data) => {
console.log(data);
setActiveUserFullInfo(true); setActiveUserFullInfo(true);
setUserFullInfoData(data); setUserFullInfoData(data);
}; };
@ -686,10 +687,8 @@ function App() {
<div> <div>
<Router> <Router>
<div className="App"> <div className="App">
{LOGIN && location?.split("/")[3] !== "exam" && ( {LOGIN && !dontShowNav && <Header logOut={logOut} />}
<Header logOut={logOut} /> {LOGIN && !dontShowNav && <Nav />}
)}
{LOGIN && location?.split("/")[3] !== "exam" && <Nav />}
<Routes> <Routes>
<Route <Route
path="/" path="/"
@ -742,7 +741,10 @@ function App() {
element={<AddProduct />} element={<AddProduct />}
/> />
<Route path="/adminpanel/add-exam" element={<AddExam />} /> <Route path="/adminpanel/add-exam" element={<AddExam />} />
<Route path="/adminpanel/user-management" element={<UserManagement />} /> <Route
path="/adminpanel/user-management"
element={<UserManagement />}
/>
<Route <Route
path="/register" path="/register"
@ -766,7 +768,7 @@ function App() {
<Route <Route
exact exact
path="/enter_exam/:id" path="/enter_exam/:id"
element={<ENTER_EXAM />} element={<ENTER_EXAM setDontShowNav={setDontShowNav} />}
/> />
<Route <Route
exact exact

@ -192,7 +192,7 @@ const ProductDesign = ({
<img <img
src={ src={
product?.fileId product?.fileId
? `https://new.andishmand.ir/api/v1/file/${product?.fileId}` ? `https://api.andishmand.ir/api/v1/file/${product?.fileId}`
: imgPlaceHolder : imgPlaceHolder
} }
className={` rounded-md w-full ${ className={` rounded-md w-full ${
@ -450,7 +450,7 @@ const ProductDesign = ({
<img <img
src={ src={
product?.fileId product?.fileId
? `https://new.andishmand.ir/api/v1/file/${product?.fileId}` ? `https://api.andishmand.ir/api/v1/file/${product?.fileId}`
: imgPlaceHolder : imgPlaceHolder
} }
className="rounded-t-xl" className="rounded-t-xl"

@ -44,7 +44,7 @@ function ShoppingCart({
let query = Object.fromEntries(new URLSearchParams(search)); let query = Object.fromEntries(new URLSearchParams(search));
const [paymentError, setPaymentError] = useState(false); const [paymentError, setPaymentError] = useState(false);
useEffect(() => { useEffect(() => {
if (query.status && window.innerWidth<1000) { if (query.status && window.innerWidth < 1000) {
if (query.status === "OK") { if (query.status === "OK") {
toast.success("پرداخت با موفقیت انجام شد"); toast.success("پرداخت با موفقیت انجام شد");
} else { } else {
@ -52,7 +52,6 @@ function ShoppingCart({
// `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} میباشد` // `عملیات پرداخت موفق نبود. شناسه پیگیری شما ${query.authority} میباشد`
// ); // );
setPaymentError(true); setPaymentError(true);
} }
setShowPaymentBox(true); setShowPaymentBox(true);
} }
@ -77,10 +76,10 @@ function ShoppingCart({
//payHandler--------------------------------------- //payHandler---------------------------------------
const payHandler = () => { const payHandler = () => {
if(window.innerWidth<1000){ if (window.innerWidth < 1000) {
alert("hoooo"); alert("hoooo");
setShowPaymentBoxM(true); setShowPaymentBoxM(true);
}else{ } else {
setShowPaymentBox(true); setShowPaymentBox(true);
} }
}; };
@ -117,7 +116,7 @@ function ShoppingCart({
className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold" className="w-full px-1 h-12 mt-1 text-white bg-red52 rounded-lg text-sm font-semibold"
onClick={() => onClick={() =>
paySchool({ paySchool({
redirectUrl: "https://new.andishmand.ir/myServices", redirectUrl: "https://api.andishmand.ir/myServices",
}) })
} }
> >
@ -260,7 +259,7 @@ function ShoppingCart({
style={{ fontSize: "0.65vw" }} style={{ fontSize: "0.65vw" }}
onClick={() => onClick={() =>
paySchool({ paySchool({
redirectUrl: "https://new.andishmand.ir/myServices", redirectUrl: "https://api.andishmand.ir/myServices",
}) })
} }
> >

@ -3,7 +3,7 @@ import React from "react";
const ShowMoreRows = ({ pageSize, setPageSize }) => { const ShowMoreRows = ({ pageSize, setPageSize }) => {
return ( return (
<select <select
className="text-white text-sm rounded cursor-pointer mr-2 bg-[#65A9FF]" className="w-32 text-white text-sm rounded cursor-pointer mr-2 bg-[#a51c45] px-1"
value={pageSize} value={pageSize}
onChange={(e) => setPageSize(Number(e.target.value))} onChange={(e) => setPageSize(Number(e.target.value))}
> >
@ -11,7 +11,7 @@ const ShowMoreRows = ({ pageSize, setPageSize }) => {
<option <option
key={pageSize} key={pageSize}
value={pageSize} value={pageSize}
className=" text-xs text-right ltr" className=" text-xs text-right ltr bg-white"
> >
نمایش {pageSize} نمایش {pageSize}
</option> </option>

@ -81,7 +81,7 @@ const Table = ({
<th <th
{...column.getHeaderProps(column.getSortByToggleProps())} {...column.getHeaderProps(column.getSortByToggleProps())}
scope="col" scope="col"
className="cursor-pointer py-2 px-2 text-right text-sm bg-[#3287B9] text-background text-white" className="cursor-pointer py-2 px-2 text-right text-sm bg-[#df1452] text-background text-white"
> >
{column.render("Header")} {column.render("Header")}
{/* {column.render("description")} */} {/* {column.render("description")} */}
@ -96,7 +96,7 @@ const Table = ({
{/* filter row */} {/* filter row */}
{console.log("...............................o")} {console.log("...............................o")}
{filtering ? ( {filtering ? (
<thead className="bg-[#F1F5FE]"> <thead className="bg-[#a51c4510]">
{headerGroups.map((headerGroup, index) => ( {headerGroups.map((headerGroup, index) => (
<tr key={index} {...headerGroup.getHeaderGroupProps()}> <tr key={index} {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => ( {headerGroup.headers.map((column) => (
@ -143,7 +143,7 @@ const Table = ({
<td colSpan={headerGroups[0].headers.length}> <td colSpan={headerGroups[0].headers.length}>
<RowDetail <RowDetail
data={data} data={data}
schema={schema.filter((e) => e.more)} schema={schema.filter((e) => e?.more)}
setTabs={setTabs} setTabs={setTabs}
tabs={tabs} tabs={tabs}
row={row.original} row={row.original}
@ -159,7 +159,7 @@ const Table = ({
{/* {tabs?.length > 1 && editor} */} {/* {tabs?.length > 1 && editor} */}
</tbody> </tbody>
{/* {tabs?.length > 1 && editor} */} {/* {tabs?.length > 1 && editor} */}
<tfoot className={`bg-blue-900 ${rows.length > 5 ? "w-full" : "hidden"}`}> {/* <tfoot className={`bg-blue-900 ${rows.length > 5 ? "w-full" : "hidden"}`}>
{footerGroups.map((footerGroup, index) => ( {footerGroups.map((footerGroup, index) => (
<tr key={index} {...footerGroup.getFooterGroupProps()}> <tr key={index} {...footerGroup.getFooterGroupProps()}>
{footerGroup.headers.map((column, index) => ( {footerGroup.headers.map((column, index) => (
@ -173,7 +173,7 @@ const Table = ({
))} ))}
</tr> </tr>
))} ))}
</tfoot> </tfoot> */}
</table> </table>
); );
}; };

@ -2,7 +2,7 @@ import React from "react";
const GoToPage = ({ pageIndex, gotoPage, pageOptions }) => { const GoToPage = ({ pageIndex, gotoPage, pageOptions }) => {
return ( return (
<span className="text-xs text-blue-400 mr-1"> <span className="text-xs text-[#df1452] mr-1">
صفحه{" "} صفحه{" "}
<input <input
className="ml-1 text-xs p-1 rounded border-blue-400 w-9" className="ml-1 text-xs p-1 rounded border-blue-400 w-9"

@ -97,7 +97,7 @@ const Tabbar = ({
aria-current="page" aria-current="page"
className={`flex flex-row items-center text-sm text-white px-2 py-0.5 text-center active rounded-sm ${ className={`flex flex-row items-center text-sm text-white px-2 py-0.5 text-center active rounded-sm ${
el?.isActive ? "text-[#fff]" : "text-[#000]" el?.isActive ? "text-[#fff]" : "text-[#000]"
} ${el?.isActive ? "bg-[#92c1fc]" : "bg-[#F1F6FF]"}`} } ${el?.isActive ? "bg-[#df145277]" : "bg-[#df145210]"}`}
> >
<div <div
className="h-full py-2 pointer-events-none" className="h-full py-2 pointer-events-none"

@ -39,7 +39,7 @@ export const Toolbar = ({
activeOtherTab={activeOtherTab} activeOtherTab={activeOtherTab}
setActiveOtherTab={setActiveOtherTab} setActiveOtherTab={setActiveOtherTab}
/> />
<div className="flex py-2 bg-surface items-center gap-2 px-2 bg-sky-200"> <div className="flex py-2 bg-[#df145277] items-center gap-2 px-2 bg-sky-200">
<TableSearch <TableSearch
globalFilter={globalFilter} globalFilter={globalFilter}
setGlobalFilter={setGlobalFilter} setGlobalFilter={setGlobalFilter}

@ -8,7 +8,7 @@ export const ColumnSearch = ({ column }) => {
<input <input
value={filterValue || ""} value={filterValue || ""}
onChange={(e) => setFilter(e.target.value)} onChange={(e) => setFilter(e.target.value)}
className={`w-full h-8 text-xs text-blue-400 bg-[#F9FBFF] border-[#B5D6FF] rounded focus:outline-none border p-1 focus:border-blue-200 focus:ring focus:ring-blue-200 focus:ring-opacity-20`} className={`w-full h-8 text-xs text-[#df1452] bg-[#F9FBFF] border-[#df145255] rounded focus:outline-none border p-1 focus:border-[#df1452] focus:ring focus:ring-[#df1452] focus:ring-opacity-20`}
/> />
</div> </div>
); );

@ -28,9 +28,11 @@ const Buttons = ({
for (let i = 0; i < newList.length; i++) { for (let i = 0; i < newList.length; i++) {
newList[i].isActive = false; newList[i].isActive = false;
} }
console.log("00000000000||0000000000000000");
console.log(row);
newList.push({ newList.push({
id: Math.floor(Math.random() * 10000), id: Math.floor(Math.random() * 10000),
name: row.original.name, name: row.original.firstName + " " + row.original.lastName,
isActive: true, isActive: true,
data: row, data: row,
element: "editor", element: "editor",
@ -64,10 +66,10 @@ const Buttons = ({
</button> </button>
</div> </div>
<div <div
className="mx-1 p-1 rounded border border-gray-300 cursor-pointer" className="mx-1 p-1 rounded border border-gray-300 cursor-pointer"
onClick={editHandler} onClick={editHandler}
> >
<img src="/icons/table/ReactTable4edit.svg" alt="" className="w-10" /> <img src="/icons/table/ReactTable4edit.svg" alt="" className="w-6" />
</div> </div>
{/* <DropDown /> */} {/* <DropDown /> */}
</div> </div>

@ -35,7 +35,7 @@ const EditButtons = ({
<div className="flex flex-row items-center justify-end"> <div className="flex flex-row items-center justify-end">
{/* add new row */} {/* add new row */}
<button <button
className="mx-1 flex flex-row items-center bg-[#65A9FF] p-2 text-xs text-white rounded border-b-2 border-blue-600" className="mx-1 flex flex-row items-center bg-[#a51c45] p-2 text-xs text-white rounded"
onClick={addNewItem} onClick={addNewItem}
> >
<div>ثبت جدید</div> <div>ثبت جدید</div>

@ -44,12 +44,12 @@ export const COLUMNS = ({
activeOtherTab, activeOtherTab,
}) => [ }) => [
...schema.map((e) => ({ ...schema.map((e) => ({
accessor: e.name, accessor: e?.name,
Header: e.description, Header: e?.description,
// Cell: e.renderer ? Components[e.renderer] : Components["text"], // Cell: e.renderer ? Components[e.renderer] : Components["text"],
Cell: e.type ? Components[e.type] : Components["text"], Cell: e?.type ? Components[e.type] : Components["text"],
Filter: e.filter ? Filters[e.filter] : Filters["ColumnSrarch"], Filter: e?.filter ? Filters[e.filter] : Filters["ColumnSrarch"],
disableSortBy: e.sort == false, disableSortBy: e?.sort == false,
Footer: "ستون " + e.description, Footer: "ستون " + e.description,
})), })),
{ {

@ -41,7 +41,7 @@ const Table = ({
const columns = useMemo( const columns = useMemo(
() => () =>
COLUMNS({ COLUMNS({
schema: schema.filter((e) => !e.more), schema: schema.filter((e) => !e?.more),
filtering, filtering,
setFiltering, setFiltering,
setTabs, setTabs,

@ -1,38 +1,41 @@
import React, { useEffect } from 'react'; import React, { useEffect } from "react";
import { useLocation, useNavigate } from 'react-router-dom'; import { useLocation, useNavigate } from "react-router-dom";
import './Header.scss'; import "./Header.scss";
import searchIcon from "../../assets/img/Group 1148.svg"; import searchIcon from "../../assets/img/Group 1148.svg";
import moment from "jalali-moment"; import moment from "jalali-moment";
import { useState } from 'react'; import { useState } from "react";
import avatar1 from "../../assets/img/avatar/pexels-jan-kopřiva-3525908.jpg"; import avatar1 from "../../assets/img/avatar/pexels-jan-kopřiva-3525908.jpg";
import logoIcon from '../../assets/img/logo.png'; import logoIcon from "../../assets/img/logo.png";
import MobileSideMenu from './MobileSideMenu'; import MobileSideMenu from "./MobileSideMenu";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { Link } from 'react-router-dom'; import { Link } from "react-router-dom";
import arrowIcon from './MobileSideMenu/arrow-down.svg' import arrowIcon from "./MobileSideMenu/arrow-down.svg";
import exitIcon from '../../assets/img/group-9.svg' import exitIcon from "../../assets/img/group-9.svg";
import backIcon from './arrow-left-1.svg'; import backIcon from "./arrow-left-1.svg";
import profileIcon from './MobileSideMenu/profile-active.svg' import profileIcon from "./MobileSideMenu/profile-active.svg";
import { user } from '../../redux/actions'; import { user } from "../../redux/actions";
import { grades } from '../../redux/reducers/public'; import { grades } from "../../redux/reducers/public";
const Header = ({ const Header = ({ isMobile, cart, logOut, setUserStatus, user }) => {
isMobile, cart,
logOut,
setUserStatus,
user
}) => {
let today = moment().locale("fa").format("YYYY/M/D"); let today = moment().locale("fa").format("YYYY/M/D");
let weekday = new Date().getDay(); let weekday = new Date().getDay();
let weekdayList = ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", 'پنجشنبه', 'جمعه', "شنبه"]; let weekdayList = [
"یکشنبه",
"دوشنبه",
"سهشنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه",
];
const [menuPopup, setMenuPopup] = useState(false); const [menuPopup, setMenuPopup] = useState(false);
const [subMenu, setSubMenu] = useState(false); const [subMenu, setSubMenu] = useState(false);
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); const navigate = useNavigate();
useEffect(() => { useEffect(() => {
setUserStatus() setUserStatus();
}, []) }, []);
let UserData =JSON.parse(localStorage.getItem("userData")); let UserData = JSON.parse(localStorage.getItem("userData"));
return ( return (
<> <>
<div <div
@ -50,7 +53,7 @@ const Header = ({
<img <img
src={ src={
UserData.picFileId UserData.picFileId
? `https://new.andishmand.ir/api/v1/file/${UserData.picFileId}` ? `https://api.andishmand.ir/api/v1/file/${UserData.picFileId}`
: profileIcon : profileIcon
} }
/> />
@ -190,7 +193,7 @@ const Header = ({
<img <img
src={ src={
UserData.picFileId UserData.picFileId
? `https://new.andishmand.ir/api/v1/file/${UserData.picFileId}` ? `https://api.andishmand.ir/api/v1/file/${UserData.picFileId}`
: profileIcon : profileIcon
} }
alt="avatar1" alt="avatar1"
@ -272,7 +275,7 @@ const Header = ({
)} )}
</> </>
); );
} };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
isMobile: state.publicApi.isMobile, isMobile: state.publicApi.isMobile,
@ -280,13 +283,11 @@ const mapStateToProps = (state) => ({
user: state.user.status, user: state.user.status,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
setUserStatus: user.setUserStatus setUserStatus: user.setUserStatus,
}; };
export default connect(mapStateToProps, mapDispatchToProps)(Header); export default connect(mapStateToProps, mapDispatchToProps)(Header);
const Clock = () => { const Clock = () => {
let today = new Date(); let today = new Date();
let h = today.getHours(); let h = today.getHours();
@ -310,4 +311,4 @@ const Clock = () => {
{h < 10 ? "0" + h : h}:{m < 10 ? "0" + m : m}:{s < 10 ? "0" + s : s} {h < 10 ? "0" + h : h}:{m < 10 ? "0" + m : m}:{s < 10 ? "0" + s : s}
</div> </div>
); );
} };

@ -1,9 +1,9 @@
export const ApiConfig = { export const ApiConfig = {
// apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg', // apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg',
// authDomain: 'dnvn.ir', // authDomain: 'dnvn.ir',
baseUrl: 'https://new.andishmand.ir/api/v1', baseUrl: "https://api.andishmand.ir/api/v1",
//baseUrl: 'http://localhost:3030/api/v1', //baseUrl: 'http://localhost:3030/api/v1',
loginURL: 'user/login', loginURL: "user/login",
otploginURL: 'user/otp/login', otploginURL: "user/otp/login",
logoutURL: 'user/logout', logoutURL: "user/logout",
}; };

@ -21,6 +21,10 @@ const exam = {
(data = {}) => (data = {}) =>
async (dispatch) => async (dispatch) =>
await proxy.put("exam/confirm", data, { dispatch }), await proxy.put("exam/confirm", data, { dispatch }),
start:
(data = {}) =>
async (dispatch) =>
await proxy.get("exam/start", data, { dispatch }),
emptySubexamList: (data = {}) => { emptySubexamList: (data = {}) => {
return (dispatch) => { return (dispatch) => {
dispatch({ dispatch({

@ -48,7 +48,7 @@ class Proxy {
let response = await fetch(); let response = await fetch();
switch (response.status) { switch (response.status) {
case 200: case 200:
dispatch({ type: url, data: response.data.data, params }); dispatch({ type: url, data: response.data.data,schema:response.data.schema, params });
return response.data.data; return response.data.data;
case 401: case 401:
if (await this.refresh()) { if (await this.refresh()) {

@ -35,7 +35,7 @@ const grades = [
]; ];
export default function book(state = initialState, action) { export default function book(state = initialState, action) {
let { type, data } = action; let { type, data, schema } = action;
switch (type) { switch (type) {
case "product/list": case "product/list":
let itemsSubject = (Array.isArray(data) ? data : []).map( let itemsSubject = (Array.isArray(data) ? data : []).map(
@ -62,8 +62,16 @@ export default function book(state = initialState, action) {
}; };
case "product/info": case "product/info":
return { ...state, loading: false, info: data, error: null }; return { ...state, loading: false, info: data, error: null };
case "product/schoolUser": case "product/schoolUsers":
return { ...state, loading: false, schoolUserList: data, error: null }; console.log("{{{{{{-..-}}}}}}}")
console.log(action)
return {
...state,
loading: false,
schoolUserList: data,
schema: schema,
error: null,
};
case "book/lesson/active": case "book/lesson/active":
return { return {
...state, ...state,

@ -10,6 +10,7 @@ const initialState = {
preview: null, preview: null,
subExamList: [], subExamList: [],
lastSubExamAdd:null, lastSubExamAdd:null,
list:null,
confirm:null confirm:null
}; };
export default function exam2(state = initialState, action) { export default function exam2(state = initialState, action) {
@ -25,13 +26,15 @@ export default function exam2(state = initialState, action) {
case "exam/parentAdd": case "exam/parentAdd":
toast.success("آزمون شما با موفقیت ثبت شد"); toast.success("آزمون شما با موفقیت ثبت شد");
return { ...state, loading: false, error: null, lastExamAdd: data.id }; return { ...state, loading: false, error: null, lastExamAdd: data.id };
case "exam/start":
return { ...state, loading: false, list: data, error: null };
case "exam/subexamAdd": case "exam/subexamAdd":
toast.success("درخواست با موفقیت انجام شد"); toast.success("درخواست با موفقیت انجام شد");
return { return {
...state, ...state,
loading: false, loading: false,
error: null, error: null,
lastSubExamAdd:data.id, lastSubExamAdd: data.id,
subExamList: [...state.subExamList, data.id], subExamList: [...state.subExamList, data.id],
}; };
case "empty_subexam_list": case "empty_subexam_list":

@ -18,6 +18,7 @@ import moment from "jalali-moment";
import { useEffect } from "react"; import { useEffect } from "react";
import { state } from "../../../../components/exam/Carousel/state"; import { state } from "../../../../components/exam/Carousel/state";
import { exam } from "../../../../redux/actions"; import { exam } from "../../../../redux/actions";
import {useNavigate} from "react-router-dom"
let gradeList = [ let gradeList = [
"اول", "اول",
@ -33,14 +34,18 @@ let gradeList = [
"یازدهم", "یازدهم",
"دوازدهم", "دوازدهم",
]; ];
const EnterExam = ({ ID, getExamInfo, examInfo }) => { const EnterExam = ({
ID,
getExamInfo,
examInfo,
startExam,
examData,
setDontShowNav,
}) => {
// const state = useSelector((state) => state.default); // const state = useSelector((state) => state.default);
console.log("Cheraaaaaaaaaaaaaa????????");
console.log(ID);
useEffect(() => { useEffect(() => {
getExamInfo({ id: ID }); getExamInfo({ id: ID });
}, []); }, []);
console.log(examInfo);
//------------------------------------------ //------------------------------------------
const [common_data] = useState(state); const [common_data] = useState(state);
let data; let data;
@ -49,64 +54,32 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
data = common_data[i]; data = common_data[i];
} }
} }
console.log("cc:" + data);
//--today date--and timer setting-----------------------------
// let today = new Date();
// let examDate = new Date(data.date)
// let diff = (examDate-today)/1000;
// let d = Math.floor(diff/86400);
// let h = Math.floor((diff-(86400*d))/3600);
// let m = Math.floor((diff-(86400*d)-(h*3600))/60);
// let s = Math.floor(diff-(86400*d)-(h*3600)-(m*60));
// const [timer,setTimer]=useState({
// d,h,m,s
// })
//----------------------------------------
const startExamBtnhandler = () => {
startExam({
examId: ID,
});
};
let navigate = useNavigate();
useEffect(() => { useEffect(() => {
// console.log(sec); if (examData) {
// if (timer.s >= 0 && diff > 0) { setDontShowNav(true);
// setTimeout(() => { navigate(`/myServices/azmoon_list/exam/${ID}`);
// // console.log("okdkdokodkd"); }
// setTimer({ }, [examData]);
// d,
// h,
// m,
// s:s-1
// });
// if (timer.s === 0) {
// setTimer({
// d,
// h,
// m:m-1,
// s:59
// });
// }
// if (timer.m === 0) {
// setTimer({
// d,
// h:h-1,
// m:59,
// s:59
// });
// }
// if (timer.h === 0) {
// setTimer({
// d:d-1,
// h:23,
// m:59,
// s:59
// });
// }
// }, 1000);
// }
});
//------------------------------------------- //-------------------------------------------
moment.locale("en"); moment.locale("en");
return ( return (
<div className="enter-exam"> <div className="enter-exam">
<div <div
className="enter-exam-box" className="enter-exam-box"
style={window.innerWidth < 1000 ? { width: "95%" } : { width: "35%",height:"auto" }} style={
window.innerWidth < 1000
? { width: "95%" }
: { width: "35%", height: "auto" }
}
> >
<div className="eeb-title-box"> <div className="eeb-title-box">
<img className="eeb-title-box-img" src={img0} alt="title-box-img" /> <img className="eeb-title-box-img" src={img0} alt="title-box-img" />
@ -118,13 +91,15 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
<div className="eeb-name-box-label">نام آزمون:</div> <div className="eeb-name-box-label">نام آزمون:</div>
<div className="eeb-name-box-name">{examInfo?.name}</div> <div className="eeb-name-box-name">{examInfo?.name}</div>
</div> </div>
<div className="eeb-level-box"> {examInfo?.gradeId && (
<img className="eeb-level-box-icon" src={icon2} alt="name-icon" /> <div className="eeb-level-box">
<div className="eeb-level-box-label">پایه تحصیلی:</div> <img className="eeb-level-box-icon" src={icon2} alt="name-icon" />
<div className="eeb-level-box-level"> <div className="eeb-level-box-label">پایه تحصیلی:</div>
{gradeList[examInfo?.gradeId - 1]} <div className="eeb-level-box-level">
{gradeList[examInfo?.gradeId - 1]}
</div>
</div> </div>
</div> )}
<div className="eeb-date-box"> <div className="eeb-date-box">
<img className="eeb-date-box-icon" src={icon3} alt="name-icon" /> <img className="eeb-date-box-icon" src={icon3} alt="name-icon" />
<div className="eeb-date-box-label">زمان آزمون:</div> <div className="eeb-date-box-label">زمان آزمون:</div>
@ -205,12 +180,13 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
<div className="eeb-created-box-label">ایجاد شده توسط</div> <div className="eeb-created-box-label">ایجاد شده توسط</div>
<div className="eeb-created-box-file">موسسه فرهنگی مصباح نور</div> <div className="eeb-created-box-file">موسسه فرهنگی مصباح نور</div>
</div> */} </div> */}
<Link <div
to={`/dashboard/azmoon_list/exam/${data?.id}`} // to={`/dashboard/azmoon_list/exam/${data?.id}`}
className="eeb-btn" className="eeb-btn"
onClick={startExamBtnhandler}
> >
شروع آزمون شروع آزمون
</Link> </div>
{/* {(new Date(data.date)>today) && {/* {(new Date(data.date)>today) &&
<div className="eeb-timer"> <div className="eeb-timer">
<div>{timer.d} روز و </div> <div>{timer.d} روز و </div>
@ -227,10 +203,12 @@ const EnterExam = ({ ID, getExamInfo, examInfo }) => {
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
examInfo: state.exam2.info, examInfo: state.exam2.info,
examData : state.exam2.list
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
getExamInfo: exam.info, getExamInfo: exam.info,
startExam : exam.start
}; };
export default connect(mapStateToProps, mapDispatchToProps)(EnterExam); export default connect(mapStateToProps, mapDispatchToProps)(EnterExam);

@ -2,13 +2,17 @@ import EnterExam from "./desktop";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
// import MobileEnterExam from "../../component/mobile/azmoon-list/M_EnterExam"; // import MobileEnterExam from "../../component/mobile/azmoon-list/M_EnterExam";
import MobileEnterExam from "./mobile"; import MobileEnterExam from "./mobile";
const ENTER_EXAM = () => { const ENTER_EXAM = ({ setDontShowNav }) => {
const { id } = useParams(); const { id } = useParams();
return ( return (
<div className="ENTER_EXAM"> <div className="ENTER_EXAM">
{window.innerWidth > 1000 && <EnterExam ID={id} />} {window.innerWidth > 1000 && (
{window.innerWidth < 1000 && <MobileEnterExam ID={id} />} <EnterExam setDontShowNav={setDontShowNav} ID={id} />
)}
{window.innerWidth < 1000 && (
<MobileEnterExam setDontShowNav={setDontShowNav} ID={id} />
)}
</div> </div>
); );
}; };

@ -21,8 +21,10 @@ let l1 = [];
let i = 0; let i = 0;
let l2 = []; let l2 = [];
const Exam = ({ ID, isMobile }) => { const Exam = ({ ID, isMobile, examData }) => {
// const state = useSelector((state) => state.default); // const state = useSelector((state) => state.default);
console.log("rtttttttttttttttttttttttttt");
console.log(examData);
const [common_data] = useState(state); const [common_data] = useState(state);
// responsive-setting-for-choice-width---------------------------------- // responsive-setting-for-choice-width----------------------------------
@ -846,8 +848,9 @@ const Exam = ({ ID, isMobile }) => {
} }
} }
return ( return isMobile ? (
isMobile ? <M_Exam /> : <M_Exam />
) : (
<> <>
{data_list.map((item) => { {data_list.map((item) => {
if (item.choices) { if (item.choices) {
@ -867,15 +870,11 @@ const Exam = ({ ID, isMobile }) => {
<div className="Es-exam-info-p1-text"> <div className="Es-exam-info-p1-text">
<div className="Es-eip1t-title"> <div className="Es-eip1t-title">
<img src={icon1} alt="hat-icon" /> <img src={icon1} alt="hat-icon" />
<div className="Es-eip1t-title-text"> <div className="Es-eip1t-title-text">{data?.name || ""}</div>
{data?.name || ""}
</div>
</div> </div>
<div className="Es-eip1t-subtitle"> <div className="Es-eip1t-subtitle">
<VscCircleFilled className="Es-eip1t-subtitle-icon" /> <VscCircleFilled className="Es-eip1t-subtitle-icon" />
<div className="Es-eip1t-subtitle-text"> <div className="Es-eip1t-subtitle-text">{data?.text}</div>
{data?.text}
</div>
</div> </div>
</div> </div>
<div className="Es-exam-info-p1-time"> <div className="Es-exam-info-p1-time">
@ -1050,6 +1049,7 @@ const mapStateToProps = (state) => ({
cartProductsLength: state.userProduct.list?.filter( cartProductsLength: state.userProduct.list?.filter(
(product) => product.condition < 2 (product) => product.condition < 2
)?.length, )?.length,
examData : state.exam2.list
}); });
const mapDispatchToProps = { const mapDispatchToProps = {

@ -1,19 +1,30 @@
import Header from "./Header"; import Header from "./Header";
import Questions from "./Questions"; import Questions from "./Questions";
import "./index.css"; import "./index.css";
import { connect } from "react-redux";
const Exam=()=>{ const Exam = ({ examData }) => {
console.log("||||||||||||||||||||||||||||");
console.log(examData);
return ( return (
<div <div
className="Exam w-[100vw] px-28 pt-16 pb-8 relative" className="Exam w-[100vw] px-28 pt-16 pb-8 relative"
style={{ width: "calc(100vw - 5px)" }} style={{ width: "calc(100vw - 5px)" }}
> >
<Header /> <Header />
<Questions /> <Questions questions={examData?.questions} />
</div> </div>
); );
} };
export default Exam; const mapStateToProps = (state) => ({
examData : state.exam2.list
});
const mapDispatchToProps = {
};
export default connect(mapStateToProps, mapDispatchToProps)(Exam);

@ -1,154 +1,192 @@
import { useEffect, useState } from "react"; import { useEffect, useMemo, useState } from "react";
import { RiErrorWarningLine } from "react-icons/ri"; import { RiErrorWarningLine } from "react-icons/ri";
import './index.css'; import './index.css';
import img1 from "../../assets/img/4bea9a991c6b23d3dcaf231513ee94bd.jpg"; import img1 from "../../assets/img/4bea9a991c6b23d3dcaf231513ee94bd.jpg";
let data = [ // let data = [
{ // {
id: 1, // id: 1,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟", // text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: null, // img: null,
choices: [ // choices: [
"گزینه اول که درست نیست", // "گزینه اول که درست نیست",
"گزینه دوم که این هم درست نیست", // "گزینه دوم که این هم درست نیست",
"گزینه سوم", // "گزینه سوم",
"همه گزینهها", // "همه گزینهها",
], // ],
guidance: null, // guidance: null,
choiceWidth: null, // choiceWidth: null,
choiceHeight: null, // choiceHeight: null,
}, // },
{ // {
id: 2, // id: 2,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟", // text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: img1, // img: img1,
choices: ["11", "22", "33", "44"], // choices: ["11", "22", "33", "44"],
guidance: // guidance:
"راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید", // "راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
choiceWidth: null, // choiceWidth: null,
choiceHeight: null, // choiceHeight: null,
}, // },
{ // {
id: 3, // id: 3,
text: null, // text: null,
img: img1, // img: img1,
choices: [ // choices: [
"گزینه کوتاه", // "گزینه کوتاه",
"گزینه متوسط", // "گزینه متوسط",
"گزینه بلند", // "گزینه بلند",
"گزینه خیلی خیلی خیلی خیلی خیلی بلـــــــند", // "گزینه خیلی خیلی خیلی خیلی خیلی بلـــــــند",
], // ],
guidance: // guidance:
"راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید", // "راهنمایی در مورد این سوال: در رابطه با سوال بالا سعی کنید دقت لازم را بعمل آورده و تمامی گذاره ها را در نظر بگیرید",
choiceWidth: null, // choiceWidth: null,
choiceHeight: null, // choiceHeight: null,
}, // },
{ // {
id: 4, // id: 4,
text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟", // text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
img: null, // img: null,
choices: [ // choices: [
"لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است ", // "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است ",
"22", // "22",
"33", // "33",
"44", // "44",
], // ],
guidance: null, // guidance: null,
choiceWidth: null, // choiceWidth: null,
choiceHeight: null, // choiceHeight: null,
}, // },
// { // // {
// id: 5, // // id: 5,
// text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟", // // text: "این سوال برای تست قرار داده میشود و ادامه پیدا میکند تا طول متن بلندتر شود و در پایان علامت سوال قرار میگیرد؟",
// img: "", // // img: "",
// choices: [ // // choices: [
// "تیرتسیذر", // // "تیرتسیذر",
// "22", // // "22",
// "بتربدر", // // "بتربدر",
// "تیدرتسر", // // "تیدرتسر",
// "تشدتنسدر", // // "تشدتنسدر",
// "ستیذزتن" // // "ستیذزتن"
// ], // // ],
// guidance:"", // // guidance:"",
// choiceWidth: null, // // choiceWidth: null,
// choiceHeight: null, // // choiceHeight: null,
// }, // // },
]; // ];
//badgeList------------- //badgeList-------------
let badgeList = ["الف", "ب", "ج", "د","هـ","ز"]; let badgeList = ["الف", "ب", "ج", "د","هـ","ز"];
const Questions = () => { const Questions = ({questions}) => {
const [Data, setData] = useState(data); const [Data, setData] = useState(null);
console.log("exam render-----------------")
console.log(Data);
const [fake, setFake] = useState(0); const [fake, setFake] = useState(0);
const [layoutTrigger,setLayoutTrigger]=useState(0);
const [answerList, setAnswerList] = useState([]); const [answerList, setAnswerList] = useState([]);
//choice layout setting-& default answer----------------- //create local data from api data -------------------------------------
const createChoices=(item)=>{
let list = [];
let options = [
item["question.option1"],
item["question.option2"],
item["question.option3"],
item["question.option4"],
item["question.option5"],
];
for (let i = 0; i < item["question.type"]; i++) {
list.push(options[i]);
}
return(list)
}
useEffect(() => { useEffect(() => {
let newData = Data; let newList =[];
let defaultAnswers = []; console.log("create data useEffect------------------------");
let Choice = document.querySelectorAll(".Choice"); for (let i = 0; i < questions?.length; i++) {
let examSize = document.querySelector(".Choice-container").offsetWidth - 58; newList.push({
console.log(examSize); id: questions[i]["question.id"],
for (let i = 0; i < data.length; i++) { text: questions[i]["question.text"],
defaultAnswers.push(""); fileId: questions[i]["question.fileId"],
console.log(i + 1 + ":-----------------------"); choices: createChoices(questions[i]),
//پیدا کردن تعداد گزینه ها guidance: questions[i]["question.help"],
let choiceNumber = data[i].choices.length; choiceWidth: null,
//پیدا کردن اندازه هر گزینه choiceHeight: null,
let wList = [];
let hList = [];
for (let j = 0; j < data[i].choices.length; j++) {
let w = Choice[i * choiceNumber + j].offsetWidth;
wList.push(w);
let h = Choice[i * choiceNumber + j].offsetHeight;
hList.push(h);
}
console.log("wList:");
console.log(wList);
wList.sort(function (a, b) {
return b - a;
});
hList.sort(function (a, b) {
return b - a;
}); });
console.log("wList:"); }
console.log(wList); setData(newList);
//پیدا کردن بزرگ ترین گزینه console.log("created data-----------------------");
let wMax = wList[0]; console.log(newList);
let hMax = hList[0]; setFake(Math.random()*10000);
console.log("wMax:" + wMax); setLayoutTrigger(Math.random() * 10000);
//چک کردن اندازه بزرگ ترین عضو با توجه به تعداد گزینه ها و اندازه صفحه و اعمال تنظیمات اندازه }, [questions]);
newData[i].choiceHeight = hMax; //--------------------------------------------------
if (wMax < 0.23 * examSize && choiceNumber === 4) { //choice layout setting-& default answer-----------------
newData[i].choiceWidth = 23; useEffect(() => {
console.log("o"); console.log(
} else if (wMax < 0.32 * examSize && choiceNumber === 3) { "choice layout setting-& default answer-----------------------"
newData[i].choiceWidth = 32; );
console.log("oo"); console.log(Data);
} else if (wMax < 0.47 * examSize && choiceNumber === 2) { if (Data) {
newData[i].choiceWidth = 48; let newData = Data;
console.log("ooo"); let data = Data;
} else if (wMax < 0.48 * examSize && choiceNumber === 4) { let defaultAnswers = [];
newData[i].choiceWidth = 48; let Choice = document.querySelectorAll(".Choice");
console.log("oooo"); let examSize =
} else if (wMax < 0.18 * examSize && choiceNumber === 5) { document.querySelector(".Choice-container")?.offsetWidth - 58;
newData[i].choiceWidth = 18; for (let i = 0; i < data?.length; i++) {
console.log("oo"); defaultAnswers.push("");
} else if (wMax < 0.15 * examSize && choiceNumber === 6) { //پیدا کردن تعداد گزینه ها
newData[i].choiceWidth = 15; let choiceNumber = data[i].choices.length;
console.log("oo"); //پیدا کردن اندازه هر گزینه
} else { let wList = [];
newData[i].choiceWidth = "full"; let hList = [];
console.log("ooooo"); for (let j = 0; j < data[i].choices.length; j++) {
let w = Choice[i * choiceNumber + j].offsetWidth;
wList.push(w);
let h = Choice[i * choiceNumber + j].offsetHeight;
hList.push(h);
}
console.log("wList:");
console.log(wList);
wList.sort(function (a, b) {
return b - a;
});
hList.sort(function (a, b) {
return b - a;
});
console.log("wList:");
console.log(wList);
//پیدا کردن بزرگ ترین گزینه
let wMax = wList[0];
let hMax = hList[0];
console.log("wMax:" + wMax);
//چک کردن اندازه بزرگ ترین عضو با توجه به تعداد گزینه ها و اندازه صفحه و اعمال تنظیمات اندازه
newData[i].choiceHeight = hMax;
if (wMax < 0.23 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 23;
} else if (wMax < 0.32 * examSize && choiceNumber === 3) {
newData[i].choiceWidth = 32;
} else if (wMax < 0.47 * examSize && choiceNumber === 2) {
newData[i].choiceWidth = 48;
} else if (wMax < 0.48 * examSize && choiceNumber === 4) {
newData[i].choiceWidth = 48;
} else if (wMax < 0.18 * examSize && choiceNumber === 5) {
newData[i].choiceWidth = 18;
} else if (wMax < 0.15 * examSize && choiceNumber === 6) {
newData[i].choiceWidth = 15;
} else {
newData[i].choiceWidth = "full";
}
} }
setData(newData);
setAnswerList(defaultAnswers);
setFake(fake + 1);
} }
setData(newData); }, [questions, layoutTrigger]);
setAnswerList(defaultAnswers);
setFake(fake + 1);
}, []);
//choose choice----------------------------- //choose choice-----------------------------
const [counter,setCounter]=useState(0); const [counter, setCounter] = useState(0);
const chooseHandler = (index, answer) => { const chooseHandler = (index, answer) => {
let list = answerList; let list = answerList;
if (list[index] !== answer) { if (list[index] !== answer) {
@ -158,7 +196,7 @@ const Questions = () => {
list[index] = answer; list[index] = answer;
} else { } else {
list[index] = ""; list[index] = "";
setCounter(counter-1); setCounter(counter - 1);
} }
setAnswerList(list); setAnswerList(list);
setFake(fake + 1); setFake(fake + 1);
@ -166,7 +204,7 @@ const Questions = () => {
return ( return (
<div className="Questions w-full mt-10"> <div className="Questions w-full mt-10">
{Data.map((item, index) => ( {Data?.map((item, index) => (
<div key={index} className="Questions-item w-full mb-24"> <div key={index} className="Questions-item w-full mb-24">
{/* -----question-text----------------------- */} {/* -----question-text----------------------- */}
<div className="Questions-item-text-container w-full flex flex-row-reverse"> <div className="Questions-item-text-container w-full flex flex-row-reverse">
@ -174,22 +212,22 @@ const Questions = () => {
{index + 1} {index + 1}
</div> </div>
<div className="Qitc-text w-full mr-2"> <div className="Qitc-text w-full mr-2">
{item.text && ( {item?.text && (
<div <div
className="w-full text-right text-base" className="w-full text-right text-base"
style={{ direction: "rtl" }} style={{ direction: "rtl" }}
> >
{item.text} {item?.text}
</div> </div>
)} )}
{/* -----question-img----------------------- */} {/* -----question-img----------------------- */}
{item.img && ( {item?.fileId && (
<div <div
className="w-full" className="w-full"
style={item.text ? { marginTop: "10px" } : null} style={item.text ? { marginTop: "10px" } : null}
> >
<img <img
src={item.img} src={item?.fileId}
alt="question-img" alt="question-img"
className="w-full rounded-md" className="w-full rounded-md"
/> />
@ -199,7 +237,7 @@ const Questions = () => {
</div> </div>
{/* -----choices----------------------------- */} {/* -----choices----------------------------- */}
<div className="Choice-container w-full pr-12 mt-10 flex flex-row-reverse justify-between flex-wrap gap-y-5"> <div className="Choice-container w-full pr-12 mt-10 flex flex-row-reverse justify-between flex-wrap gap-y-5">
{item.choices.map((choice, INDEX) => ( {item?.choices?.map((choice, INDEX) => (
<div <div
key={INDEX} key={INDEX}
className="Choice flex shrink-0 flex-row-reverse cursor-pointer" className="Choice flex shrink-0 flex-row-reverse cursor-pointer"

@ -1,29 +1,25 @@
import React, { useEffect } from "react";
import { useState } from "react";
import React, { useEffect } from 'react'
import { useState } from 'react';
// import { Document, Page } from "react-pdf"; // import { Document, Page } from "react-pdf";
import { Viewer, Worker } from "@react-pdf-viewer/core"; import { Viewer, Worker } from "@react-pdf-viewer/core";
// Import the styles // Import the styles
import "@react-pdf-viewer/core/lib/styles/index.css"; import "@react-pdf-viewer/core/lib/styles/index.css";
const optionNum = ["", "الف", "ب", "پ", "ت", "ث", "ج", "چ", "ح"]; const optionNum = ["", "الف", "ب", "پ", "ت", "ث", "ج", "چ", "ح"];
const ViewExamNote = ({ notes ,questions}) => { const ViewExamNote = ({ notes, questions }) => {
const [activeNote,setActiveNote]=useState(0); const [activeNote, setActiveNote] = useState(0);
const [activeFileId, setActiveFileId] = useState(null); const [activeFileId, setActiveFileId] = useState(null);
const changeNoteHandler=(index,fileId)=>{ const changeNoteHandler = (index, fileId) => {
setActiveNote(index); setActiveNote(index);
setActiveFileId(fileId); setActiveFileId(fileId);
} };
useEffect(()=>{ useEffect(() => {
setActiveFileId(notes[0].fileId); setActiveFileId(notes[0].fileId);
},[notes]) }, [notes]);
console.log("rrrrrrrrrrrr============") console.log("rrrrrrrrrrrr============");
console.log(activeFileId); console.log(activeFileId);
const createOptions = (item) => { const createOptions = (item) => {
@ -63,11 +59,11 @@ const ViewExamNote = ({ notes ,questions}) => {
> >
<Worker workerUrl="https://unpkg.com/pdfjs-dist@2.13.216/build/pdf.worker.min.js"> <Worker workerUrl="https://unpkg.com/pdfjs-dist@2.13.216/build/pdf.worker.min.js">
<Viewer <Viewer
fileUrl={`https://new.andishmand.ir/api/v1/file/${activeFileId}`} fileUrl={`https://api.andishmand.ir/api/v1/file/${activeFileId}`}
/> />
</Worker> </Worker>
{/* <Document {/* <Document
file={`https://new.andishmand.ir/api/v1/file/${activeFileId}`} file={`https://api.andishmand.ir/api/v1/file/${activeFileId}`}
onLoadSuccess={onDocumentLoadSuccess} onLoadSuccess={onDocumentLoadSuccess}
> >
<Page pageNumber={pageNumber} /> <Page pageNumber={pageNumber} />
@ -130,4 +126,4 @@ const ViewExamNote = ({ notes ,questions}) => {
); );
}; };
export default ViewExamNote export default ViewExamNote;

@ -1,14 +1,12 @@
import closeBtn from "../../assets/img/Group 1862.svg"; import closeBtn from "../../assets/img/Group 1862.svg";
import React from "react";
import React from 'react'
const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => { const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
const closeHandler=()=>{ const closeHandler = () => {
setShowBudget(false); setShowBudget(false);
setBudgetFileId(false); setBudgetFileId(false);
} };
return ( return (
<div <div
className="w-[93.5vw] h-[93.5vh] fixed top-[6.5%] left-0 flex justify-center backdrop-blur bg-[#9999991A] overflow-y-auto z-[100]" className="w-[93.5vw] h-[93.5vh] fixed top-[6.5%] left-0 flex justify-center backdrop-blur bg-[#9999991A] overflow-y-auto z-[100]"
@ -24,7 +22,7 @@ const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
<div className="w-[70%] mt-16"> <div className="w-[70%] mt-16">
{budgetFileId && ( {budgetFileId && (
<img <img
src={`https://new.andishmand.ir/api/v1/file/${budgetFileId}`} src={`https://api.andishmand.ir/api/v1/file/${budgetFileId}`}
alt="" alt=""
className="w-full" className="w-full"
/> />
@ -39,4 +37,4 @@ const Budget = ({ setShowBudget, setBudgetFileId, budgetFileId }) => {
); );
}; };
export default Budget export default Budget;

@ -144,12 +144,12 @@ const PaymentBox = ({
if (window.innerWidth > 1000) { if (window.innerWidth > 1000) {
payment({ payment({
price: item.amount, price: item.amount,
redirectUrl: "https://new.andishmand.ir/services", redirectUrl: "https://api.andishmand.ir/services",
}); });
} else { } else {
payment({ payment({
price: item.amount, price: item.amount,
redirectUrl: "https://new.andishmand.ir/shoppingCart", redirectUrl: "https://api.andishmand.ir/shoppingCart",
}); });
} }
// payment({ // payment({

@ -13,7 +13,7 @@ const servicePopUp = ({
setShowBudget, setShowBudget,
setBudgetFileId, setBudgetFileId,
userInfo, userInfo,
pushToCart pushToCart,
}) => { }) => {
console.log(")))))(((((((((("); console.log(")))))((((((((((");
console.log(content); console.log(content);
@ -38,10 +38,10 @@ const servicePopUp = ({
console.log(childList); console.log(childList);
console.log(parentLength); console.log(parentLength);
if (parentLength === childList.length) { if (parentLength === childList.length) {
pushToCart({ productId :content.product.id,count:1}); pushToCart({ productId: content.product.id, count: 1 });
} else { } else {
for(let j=0;j<childList.length;j++){ for (let j = 0; j < childList.length; j++) {
pushToCart({productId:childList[j],count:1}) pushToCart({ productId: childList[j], count: 1 });
} }
} }
}; };
@ -266,21 +266,23 @@ const servicePopUp = ({
</div> </div>
))} ))}
</div> </div>
{rulesAccepted && <div className="w-full flex mt-5"> {rulesAccepted && (
<div <div className="w-full flex mt-5">
className="w-40 h-12 rounded bg-[#DF1452] flex items-center justify-center text-[#fff] cursor-pointer text-sm" <div
onClick={addToCartHandler} className="w-40 h-12 rounded bg-[#DF1452] flex items-center justify-center text-[#fff] cursor-pointer text-sm"
> onClick={addToCartHandler}
افزودن به سبد خرید >
افزودن به سبد خرید
</div>
</div> </div>
</div>} )}
</div> </div>
)} )}
{content.id === 3 && ( {content.id === 3 && (
<video className="w-1/2 rounded-md" controls> <video className="w-1/2 rounded-md" controls>
<source <source
src={`https://new.andishmand.ir/api/v1/file/${content?.video}`} src={`https://api.andishmand.ir/api/v1/file/${content?.video}`}
type="video/mp4" type="video/mp4"
/> />
</video> </video>
@ -288,7 +290,7 @@ const servicePopUp = ({
{content.id === 1 && ( {content.id === 1 && (
<img <img
src={`https://new.andishmand.ir/api/v1/file/${content?.product?.fileId}`} src={`https://api.andishmand.ir/api/v1/file/${content?.product?.fileId}`}
className="w-1/3 rounded-md mt-4" className="w-1/3 rounded-md mt-4"
alt="Content" alt="Content"
/> />

@ -27,6 +27,8 @@ const UserManagement = ({
}, []); }, []);
// console.log(info); // console.log(info);
console.log(schoolList); console.log(schoolList);
console.log("==============^tabs^==============");
console.log(tabs);
useEffect(() => { useEffect(() => {
setTabs([ setTabs([
{ {
@ -38,6 +40,8 @@ const UserManagement = ({
]); ]);
}, []); }, []);
console.log("ProductManagement render---------------------------------"); console.log("ProductManagement render---------------------------------");
console.log(info);
console.log(schoolUserList);
// console.log(tabs); // console.log(tabs);
// const [tabs, setTabs] = useState([ // const [tabs, setTabs] = useState([
// { // {
@ -87,8 +91,8 @@ const UserManagement = ({
)} )}
<div className="flex flex-1 w-full pt-12 pb-4"> <div className="flex flex-1 w-full pt-12 pb-4">
<Table <Table
data={info.list || []} data={info?.schoolUserList || []}
schema={info.schema || []} schema={info?.schema || []}
Editor={Editor} Editor={Editor}
add={add} add={add}
update={update} update={update}
@ -106,7 +110,7 @@ const UserManagement = ({
); );
}; };
const mapStateToProps = (state) => ({ const mapStateToProps = (state) => ({
info: state[source].schoolUserList, info: state[source],
tabs: state.table.tabs, tabs: state.table.tabs,
schoolList: state.book.list, schoolList: state.book.list,
schoolUserList: state.book.schoolUserList, schoolUserList: state.book.schoolUserList,

@ -181,7 +181,7 @@ const datehandler=(value,mode)=>{
))} ))}
</div> </div>
<div <div
className="px-6 py-4 w-fit rounded-md bg-[#3C58EB] text-[#fff] text-base cursor-pointer mx-auto mt-6" className="px-6 py-4 w-fit rounded-md bg-[#df1452] text-[#fff] text-base cursor-pointer mx-auto mt-6"
onClick={submitHandler} onClick={submitHandler}
> >
{data ? "ثبت تغییرات" : "ثبت ردیف"} {data ? "ثبت تغییرات" : "ثبت ردیف"}

Loading…
Cancel
Save