U
    i#=                     @   sz  d dl mZ d dlmZmZmZ d dlmZmZm	Z	m
Z
mZ d dlmZmZ d dlmZmZ d dlmZmZ e ZG dd dejZG d	d
 d
ejZG dd dejZG dd dejZG dd dejZG dd dejZG dd dejZdddddddddddd gd!d"d#d$d%d&d'd(d)d*d+d,gd-d.d/d0d1d2d3d4d5d6d7d8gd9d:d;d<d=d>d?d@dAdBdCdDdEgdFdGdHdIdJdKdLdMdNdOdPdQdRdSgdTdUdVdWdXdYdZd[gdUd\dXd]d^d_d`dBgdadbdcdXdddedfdggdhdidjdkdld^d_dcdmdndodpdqdrdsgdtdidudvdwd_djdxdndodydqdrdsgdzd{d|d}d~dddddddddrdsgd{ddddddddddddsgdddddddddddddgddddddddddddgdddd/ddddddddDdgdddddddd^ddddgddddddddd[ddddgddTdUdVdWdd[ddddd8ddXgdUdad\dd[dddddd^d_doddXgdzddbdadddedddddgdjdXgdddddddd_ddjdxdrgddZdvd[dddndxdrddsgdzd{ddvdd}ddjdxddrdsgd{dddddjdddg	ddZdS )    )
SQLAlchemy)Mappedmapped_columnrelationship)IntegerStringJSON
ForeignKeyBoolean)datetimetimezone)generate_password_hashcheck_password_hash)ListDictc                   @   s   e Zd ZU dZee dddZee e	d< ee
dddZee e	d< ee
dddd	Zee e	d
< ee
dddZee e	d< ee dddZee e	d< ee
dddZee e	d< eddddZeddddZdd Zdd ZdS )SchoolTableZschoolsTprimary_keyautoincrementid   Fnullableschool_namer   unique	school_id2   streamr   default
isLoggedIn   passwordTeacherTableschoolzall, delete)back_populatescascadeStudentTablec                 C   s   t || _d S Nr   r#   selfr#    r-   /var/www/b2b/models.pyset_password   s    zSchoolTable.set_passwordc                 C   s   t | j|S r)   r   r#   r+   r-   r-   r.   check_password   s    zSchoolTable.check_passwordN)__name__
__module____qualname____tablename__r   r   r   r   int__annotations__r   r   strr   r   r
   r!   boolr#   r   teachersstudentsr/   r1   r-   r-   r-   r.   r   	   s   
r   c                   @   sD  e Zd ZU dZee dddZee e	d< ee
dddZee e	d< ee
dddZee e	d	< ee
d
dddZee e	d< ee
dddZee e	d< eeddZeee  e	d< edd dZee e	d< edd dZee e	d< ee dddZee e	d< eedddZee e	d< edddZdd Zdd ZdS ) r$   r:   Tr   r   r"   Fr   	firstnamelastname   r   usernamer#   gradesc                   C   s   t tjS r)   r   nowr   utcr-   r-   r-   r.   <lambda>%       zTeacherTable.<lambda>r    
created_atc                   C   s   t tjS r)   rA   r-   r-   r-   r.   rD   &   rE   
last_loginr    r   r!   
schools.idr   r   r&   c                 C   s   t |d| _d S )N)r#   r*   r+   r-   r-   r.   r/   ,   s    zTeacherTable.set_passwordc                 C   s   t | j|S r)   r0   r+   r-   r-   r.   r1   /   s    zTeacherTable.check_passwordN)r2   r3   r4   r5   r   r   r   r   r6   r7   r   r<   r8   r=   r?   r#   r   r@   r   r   rG   r   rH   r
   r!   r	   r   r   r%   r/   r1   r-   r-   r-   r.   r$      s   
r$   c                   @   s  e Zd ZU dZee dddZee e	d< ee
ddddZee e	d< ee
d	dd
Zee e	d< ee
ddd
Zee e	d< ee
ddd
Zee e	d< ee
ddddZee e	d< ee dddZee e	d< ee dddZee e	d< ee dddZee e	d< ee
ddd
Zee e	d< ee
d	dd
Zee e	d< ee dd
Zee e	d< edd d Zee e	d!< ed"d d Zee e	d#< ee ddd$Zee e	d%< eed&dd
Zee e	d'< ed(dd)Zd*d+ Z d,d- Z!d.S )/r(   r;   Tr   r      Fr   r?   r"   r   r#   
   grade   section   u   👨‍🎓r   avatari  coins(   gems   streakr   r<   r=   roll_noc                   C   s   t tjS r)   rA   r-   r-   r-   r.   rD   A   rE   zStudentTable.<lambda>rF   rG   c                   C   s   t tjS r)   rA   r-   r-   r-   r.   rD   B   rE   rH   rI   r!   rJ   r   r   rK   c                 C   s   t || _d S r)   r*   r+   r-   r-   r.   r/   H   s    zStudentTable.set_passwordc                 C   s   t | j|S r)   r0   r+   r-   r-   r.   r1   K   s    zStudentTable.check_passwordN)"r2   r3   r4   r5   r   r   r   r   r6   r7   r   r?   r8   r#   rN   rP   rR   rS   rU   rW   r<   r=   rX   rG   r   rH   r
   r!   r	   r   r   r%   r/   r1   r-   r-   r-   r.   r(   2   s(   
r(   c                   @   s   e Zd ZU dZee dddZee e	d< ee
dddZee e	d< ee
d	ddZee e	d
< eedddZee e	d< eedddZee e	d< eeddZeee  e	d< eeddZeee  e	d< edd dZee e	d< edZedZdS )TeacherAssessmentTableteacher_assessmentsTr   r   rJ   Fr   r   zteachers.id
created_byrM   rN   rP   concepts	questionsc                   C   s   t tjS r)   rA   r-   r-   r-   r.   rD   X   rE   zTeacherAssessmentTable.<lambda>rF   rG   r   r$   N)r2   r3   r4   r5   r   r   r   r   r6   r7   r	   r   r[   r   rN   r8   rP   r   r\   r   r]   r   rG   r   r   r%   teacherr-   r-   r-   r.   rY   N   s   
rY   c                   @   s   e Zd ZU dZee ddddZee e	d< ee
dddZee e	d< ee
d	ddZee e	d
< eedddZee e	d< eedddZee e	d< ee
dddZee e	d< eeddZeee  e	d< edd dZee e	d< dS )StudentAssesmentResultTableZstudent_assesment_resultsFT)r   r   r   r   zstudents.idr   
student_idrJ   r   rM   rN   rP   zteacher_assessments.idassesment_idconcept_detailc                   C   s   t tjS r)   rA   r-   r-   r-   r.   rD   g   rE   z$StudentAssesmentResultTable.<lambda>rF   submitted_atN)r2   r3   r4   r5   r   r   r   r   r6   r7   r	   r`   r   r   rN   r8   rP   ra   r   rb   r   r   rc   r   r-   r-   r-   r.   r_   ]   s   
r_   c                   @   s   e Zd ZU dZee dddZee e	d< ee
dddZee e	d< ee
dZee e	d	< ee ddd
Zee e	d< ee
ddddZee e	d< ee
dddZee e	d< eedddZee e	d< dd Zdd ZdS )PrincipalTableZ
principalsTr   r   r   Fr   r<   r=   r   r!   r"   r   r?   r#   rJ   r   c                 C   s   t || _d S r)   r*   r+   r-   r-   r.   r/   t   s    zPrincipalTable.set_passwordc                 C   s   t | j|S r)   r0   r+   r-   r-   r.   r1   w   s    zPrincipalTable.check_passwordN)r2   r3   r4   r5   r   r   r   r   r6   r7   r   r<   r8   r=   r
   r!   r9   r?   r#   r	   r   r/   r1   r-   r-   r-   r.   rd   i   s   
rd   c                   @   sx   e Zd ZdZejejddZejedddZ	ejedddZ
ejedddZeejZedd	d
fZdS )Conceptz0Concepts/topics for different grades and streamsT)r   d   Fr   rQ   Zidx_grade_streamrN   r   N)r2   r3   r4   __doc__dbColumnr   r   r   namerN   r   TextdescriptionIndexZ__table_args__r-   r-   r-   r.   re   z   s   re   zCounting 1-100zNumber RecognitionzBefore and After NumberszGreater and SmallerzAddition (1-10)zSubtraction (1-10)zShapes and PatternszLength and HeightzWeight ComparisonzDays and MonthszTime (Hours)zMoney (Coins)zCounting 1-1000zPlace Value (Ones, Tens)zSkip CountingzAddition (1-50)zSubtraction (1-50)zIntroduction to MultiplicationzEven and Odd Numbersz2D and 3D ShapeszMeasurement (cm, m)zTime (Half Hours)zMoney (Notes and Coins)zData Handling (Pictographs)zNumbers up to 10,000z!Place Value (Hundreds, Thousands)z"Addition and Subtraction (3-digit)zMultiplication Tables (2-10)zDivision BasicszFractions (Half, Quarter)zSimple PatternszPerimeter and Area BasicszTime (Minutes)zMoney Problemsz
Bar GraphsZSymmetryzNumbers up to 1,00,000zRoman NumeralszFactors and Multiplesz"Addition and Subtraction (4-digit)u#   Multiplication (2-digit × 2-digit)zDivision (Long Division)z#Fractions (Proper, Improper, Mixed)zDecimals IntroductionzAngles and LineszPerimeter and AreazTime ProblemszMoney Word ProblemszData Handling (Tables)zLarge Numbers (Lakhs, Crores)zPrime and Composite NumberszHCF and LCMzFour Operations (Large Numbers)zFractions (All Operations)zDecimals (Operations)zPercentages BasicszRatio and Proportion IntrozSimple Interest BasicszPerimeter and Area (Complex)zVolume BasicszCoordinate Geometry IntrozData InterpretationzAverage and MeanzWhole NumbersZIntegersZ	FractionsZDecimalszData HandlingZMensurationZAlgebrazRatio and ProportionzFractions and DecimalszSimple EquationszLines and AnglesZ	TrianglesZ
CongruencezRational NumberszLinear EquationsZQuadrilateralszSquares and Square RootszCubes and Cube RootszComparing QuantitieszAlgebraic ExpressionszNumber SystemsZPolynomialszCoordinate Geometryz!Linear Equations in Two VariableszEuclid's Geometryz%Areas of Parallelograms and TrianglesZCirclesZConstructionszHeron's FormulazSurface Areas and VolumesZ
StatisticsZProbabilityzReal Numbersz)Pair of Linear Equations in Two VariableszQuadratic EquationszArithmetic ProgressionsZTrigonometryzAreas Related to CirclesZSetszRelations and FunctionszTrigonometric FunctionszMathematical InductionzComplex NumberszLinear InequalitieszPermutations and CombinationszBinomial TheoremzSequences and SerieszStraight LineszConic SectionszIntroduction to 3D GeometryzLimits and DerivativeszInverse Trigonometric FunctionsZMatricesZDeterminantsz Continuity and DifferentiabilityzApplications of DerivativesZ	IntegralszApplications of IntegralszDifferential EquationszVector Algebraz3D GeometryzLinear Programming)123456789101112zNumbers 1-100zCounting and Number NameszBefore, After, BetweenzComparison of NumberszAddition Facts (1-10)zSubtraction Facts (1-10)zBasic ShapesZPatternszMeasurement (Longer, Shorter)zCalendar BasicszTime (O'clock)zMoney RecognitionzNumbers up to 1000zPlace Value (Tens, Ones)zOrdinal NumberszAddition (2-digit)zSubtraction (2-digit)zTimes Tables (2, 5, 10)zOdd and EvenzGeometry ShapeszLength (Inches, Feet)zTime (Half Past)zMoney (Paise, Rupees)zSimple GraphszNumbers up to 9999zPlace Value ChartzRounding Numbersu#   Multiplication (1-digit × 2-digit)zDivision ConceptszIntroduction to FractionszPatterns and SequenceszPerimeter of ShapeszCapacity (Liters)zTime DurationzPictographs and Bar ChartszLarge Numbers (Lakhs)zRoman Numerals (I-C)zMultiples and FactorszLong MultiplicationzLong DivisionzEquivalent FractionszDecimals (Tenths)zArea and PerimeterzTime (12-hour and 24-hour)zMoney Calculationsz!Data Handling (Charts and Graphs)zLarge Numbers (Crores)zPrime and CompositezTests of DivisibilityzFractions (Mixed Operations)zDecimals (All Operations)zIntroduction to PercentageszSimple InterestzUnitary Methodz$Geometry (Triangles, Quadrilaterals)zVolume and CapacityzSymmetry and ReflectionzStatistics BasicszNatural NumbersZ
PercentagezProfit and LosszBasic Geometrical ConceptszPractical GeometryZ	ExponentszProfit, Loss and DiscountzFundamental ConceptsZ
CongruencyzDirected NumberszSimple and Compound InterestzDirect and Inverse VariationsZFactorisationzRational and Irrational NumberszCompound InterestZ
ExpansionsZFactorizationszSimultaneous Linear EquationsZIndicesZ
LogarithmszMean and MedianzCommercial MathematicsZ
SimilarityZLociZ
Histogramsz%Logarithmic and Exponential FunctionszQuadratic FunctionsZCalculuszProbability DistributionszSampling Theory)CBSEICSEN)Zflask_sqlalchemyr   Zsqlalchemy.ormr   r   r   
sqlalchemyr   r   r   r	   r
   r   r   Zwerkzeug.securityr   r   typingr   r   rh   ZModelr   r$   r(   rY   r_   rd   re   CONCEPTS_DATAr-   r-   r-   r.   <module>   sR                                          	
                                     C                                       	
                                        