bug fixes psychometic

This commit is contained in:
vinoth 2024-11-22 18:08:05 +05:30
parent 97caa2a276
commit 0ec43ce473
9 changed files with 54 additions and 7 deletions

View File

@ -150,7 +150,7 @@ export const MONTHLIST = [
numberPatten: /^\d{10}$/, numberPatten: /^\d{10}$/,
commonEmailPatter: /[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,3}$/, //NOSONAR commonEmailPatter: /[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,3}$/, //NOSONAR
emailPatten: /^([a-z|0-9](\.|_){0,1})+[a-z|0-9]\@([a-z|0-9])+((\.){0,1}[a-z|0-9]){2}\.[a-z]{2,3}$/gm, //NOSONAR emailPatten: /^([a-z|0-9](\.|_){0,1})+[a-z|0-9]\@([a-z|0-9])+((\.){0,1}[a-z|0-9]){2}\.[a-z]{2,3}$/gm, //NOSONAR
passwordPatten: /^(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,12}$/, //NOSONAR passwordPatten: /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,12}$/, //NOSONAR
phoneRegExp: /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/, //NOSONAR phoneRegExp: /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/, //NOSONAR
address: /^\S+(?: \S+)*$/, //NOSONAR address: /^\S+(?: \S+)*$/, //NOSONAR
} }

View File

@ -29,7 +29,7 @@ export const passwordStrengthValidator = (password:any) => {
return 'Password cannot be empty.' return 'Password cannot be empty.'
} }
if (!re.test(password)) { if (!re.test(password)) {
return 'Password atleast 8 character,one upper case, one number and one special characters.' return 'Password atleast 8 character,one upper case, one lower case, one number and one special characters.'
} }
return '' return ''

View File

@ -21,6 +21,8 @@ import TeacherUpdate from '@screens/Teacher/TeacherUpdate' //NOSONAR
import TeacherInfo from '@screens/Teacher/TeacherInfo' //NOSONAR import TeacherInfo from '@screens/Teacher/TeacherInfo' //NOSONAR
import TeacherAttendance from "@screens/Teacher/TeacherAttendance" //NOSONAR import TeacherAttendance from "@screens/Teacher/TeacherAttendance" //NOSONAR
import HomePsychometric from "@screens/Pscyometric/HomePsychometric" import HomePsychometric from "@screens/Pscyometric/HomePsychometric"
import StudentListPsychometric from "@screens/Pscyometric/StudentListPsychometric"
import Greetings from "@screens/Greetings" //NOSONAR import Greetings from "@screens/Greetings" //NOSONAR
const Drawer = createDrawerNavigator(); const Drawer = createDrawerNavigator();
@ -78,7 +80,7 @@ const DrawerNavigator = () => {
<Drawer.Screen name="SchoolUpdate" component={SchoolUpdate} /> <Drawer.Screen name="SchoolUpdate" component={SchoolUpdate} />
<Drawer.Screen name="Class" component={ClassStackNavigator} /> <Drawer.Screen name="Class" component={ClassStackNavigator} />
<Drawer.Screen name="TeacherAttendance" component={TeacherAttendance} /> <Drawer.Screen name="TeacherAttendance" component={TeacherAttendance} />
<Drawer.Screen name="Pscyometric" component={HomePsychometric} /> <Drawer.Screen name="Pscyometric" component={StudentListPsychometric} />
{/* <Drawer.Screen name="ClassCreate" component={ClassCreate} /> */} {/* <Drawer.Screen name="ClassCreate" component={ClassCreate} /> */}
{/* <Drawer.Screen name="ClassUpdate" component={ClasslUpdate} /> */} {/* <Drawer.Screen name="ClassUpdate" component={ClasslUpdate} /> */}
<Drawer.Screen name="TeacherView" component={TeeacherStackNavigator} /> <Drawer.Screen name="TeacherView" component={TeeacherStackNavigator} />

View File

@ -50,6 +50,11 @@ export const homestudy = (state = defaultState, action: any) => {
case GET_HOME_STUDY_LIST_FAILURE: case GET_HOME_STUDY_LIST_FAILURE:
return { ...state, loading: false, error: action.error } return { ...state, loading: false, error: action.error }
case GENERATE_HOME_STUDY_RANDOM_QUESTION_SUCCESS: case GENERATE_HOME_STUDY_RANDOM_QUESTION_SUCCESS:
if (response.hasOwnProperty('status')) {
if (!response.status) {
Toast.show(response.message, Toast.SHORT)
}
}
return { ...state, loading: false, random_question: response } return { ...state, loading: false, random_question: response }
case GET_HOME_STUDY_TRANSACTION_DETAILS_SUCCESS: case GET_HOME_STUDY_TRANSACTION_DETAILS_SUCCESS:
return { ...state, loading: false, home_study_details: response } return { ...state, loading: false, home_study_details: response }

View File

@ -190,7 +190,10 @@ class CreatePassword extends React.Component<any, any>{
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 uppercase</Text> <Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 uppercase</Text>
</View> </View>
<View style={AuthStyles.passwordContainer}> <View style={AuthStyles.passwordContainer}>
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 lowercase</Text>
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 number</Text> <Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 number</Text>
</View>
<View style={AuthStyles.passwordContainer}>
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 Symbol</Text> <Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 Symbol</Text>
</View> </View>
<TouchableOpacity style={BaseStyles.loginBtn} onPress={this.onSetPassWord.bind(this)} disabled={this.props.loading} activeOpacity={0.8}> <TouchableOpacity style={BaseStyles.loginBtn} onPress={this.onSetPassWord.bind(this)} disabled={this.props.loading} activeOpacity={0.8}>

View File

@ -203,6 +203,7 @@ class HomeStudyGenerateQuestions extends React.Component<any, any>{
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
{this.props.homestudyLoading && <ActivityIndicator size="large" color="#7165e3" />}
</ScrollView> </ScrollView>
</View> </View>
)} )}
@ -240,6 +241,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state: any) => ({ const mapStateToProps = (state: any) => ({
loading: state.questionbank.loading, loading: state.questionbank.loading,
isLoading: state.students.loading, isLoading: state.students.loading,
homestudyLoading: state.homestudy.loading,
blueprintSubject: state.questionbank.bluprint_subject_dropdown, blueprintSubject: state.questionbank.bluprint_subject_dropdown,
blueprintLesson: state.questionbank.bluprint_lesson_dropdown, blueprintLesson: state.questionbank.bluprint_lesson_dropdown,
records: state.questionbank.assessmentrecords, records: state.questionbank.assessmentrecords,

View File

@ -93,7 +93,7 @@ class QuestionScreen extends React.Component<any, any>{
}) })
} }
handleBack = async () => { handleBack = async () => {
await this.props.getPsychometricStudentDropdownByClass({ token: this.token, academic_year: this.state.academicYear.toString() })
this.props.navigation.navigate("Pscyometric") this.props.navigation.navigate("Pscyometric")
} }
handleNext = async () => { handleNext = async () => {
@ -413,6 +413,9 @@ const mapDispatchToProps = (dispatch: any) => ({
getPsychometricCasheAnswer: (user: any) => { getPsychometricCasheAnswer: (user: any) => {
dispatch(ActionCreators.getPsychometricCasheAnswer(user)) dispatch(ActionCreators.getPsychometricCasheAnswer(user))
}, },
getPsychometricStudentDropdownByClass: (user: any) => {
dispatch(ActionCreators.getPsychometricStudentDropdownByClass(user))
},
}) })
QuestionScreen.propTypes = { QuestionScreen.propTypes = {

View File

@ -257,6 +257,7 @@ class ReportPsychometric extends React.Component<any, any>{
position: 'BOTTOM', position: 'BOTTOM',
labelRotationAngle: -60, // Rotate the labels to make them vertical labelRotationAngle: -60, // Rotate the labels to make them vertical
drawLabels: true, drawLabels: true,
textColor: processColor('#282313'),
}} }}
yAxis={{ yAxis={{
left: { left: {
@ -265,6 +266,7 @@ class ReportPsychometric extends React.Component<any, any>{
}, },
right: { right: {
enabled: true, enabled: true,
textColor: processColor('#282313'),
}, },
}} }}
animation={{ durationX: 1000 }} animation={{ durationX: 1000 }}

View File

@ -25,7 +25,8 @@ class StudentListPsychometric extends React.Component<any, any>{
scrollView: any; scrollView: any;
token: any; token: any;
state: any = { state: any = {
academicYear: '' academicYear: '',
parent:false
}; };
constructor(props: any) { constructor(props: any) {
@ -41,7 +42,16 @@ class StudentListPsychometric extends React.Component<any, any>{
const userInfo = await AsyncStorage.getItem('userInfo') const userInfo = await AsyncStorage.getItem('userInfo')
if (this.token) { if (this.token) {
if (this.props.route.params.hasOwnProperty('data')) {
if (userInfo) {
const userDetails: any = JSON.parse(userInfo)
this.isLoggedinAs = userDetails.usertype
if (userDetails.usertype === UserRoles.parent) {
this.setState({parent:true})
}
}
if (this.props?.route?.params?.hasOwnProperty('data')) {
const dataParams: any = this.props.route.params.data const dataParams: any = this.props.route.params.data
this.props.getPsychometricStudentDropdownByClass({ token: this.token, academic_year: this.state.academicYear.toString(), class_id: dataParams.id }) this.props.getPsychometricStudentDropdownByClass({ token: this.token, academic_year: this.state.academicYear.toString(), class_id: dataParams.id })
} else { } else {
@ -90,6 +100,10 @@ class StudentListPsychometric extends React.Component<any, any>{
} }
} }
toClass = () => {
this.props.navigation.navigate("ClassListPsychometric")
}
renderRow = ({ item }: any) => ( renderRow = ({ item }: any) => (
<TouchableOpacity style={[BaseStyles.padHorizontal10, AppStyles.CardView, AppStyles.studentCard]} onPress={this.toQuizScreen.bind(this, item)} <TouchableOpacity style={[BaseStyles.padHorizontal10, AppStyles.CardView, AppStyles.studentCard]} onPress={this.toQuizScreen.bind(this, item)}
activeOpacity={0.8}> activeOpacity={0.8}>
@ -118,13 +132,16 @@ class StudentListPsychometric extends React.Component<any, any>{
render() { render() {
let label: any = 'Select Student' let label: any = 'Select Student'
if (this.props.route.params.hasOwnProperty('data')) { if (this.props?.route?.params?.hasOwnProperty('data')) {
const dataParams: any = this.props.route.params.data const dataParams: any = this.props.route.params.data
label = dataParams.grade_standard label = dataParams.grade_standard
} }
return (<View style={[AppStyles.containerWoPadding, {}]}> return (<View style={[AppStyles.containerWoPadding, {}]}>
<Text style={BaseStyles.topHeader}>{label}</Text> <Text style={BaseStyles.topHeader}>{label}</Text>
{!this.props?.route?.params?.hasOwnProperty('data') && !this.state.parent && <TouchableOpacity style={[styles.primaryBtn, ]} onPress={this.toClass} activeOpacity={0.8}>
<Text style={styles.btnText}> Filter by Class </Text>
</TouchableOpacity> }
{!this.props.loading && this.props.studentList && <FlatList {!this.props.loading && this.props.studentList && <FlatList
style={{ marginVertical: 12, marginHorizontal: 16 }} style={{ marginVertical: 12, marginHorizontal: 16 }}
data={this.props.studentList} data={this.props.studentList}
@ -157,6 +174,19 @@ const styles = StyleSheet.create({
backgroundColor: BaseColors.danger, backgroundColor: BaseColors.danger,
color: BaseColors.lightBlack, color: BaseColors.lightBlack,
}, },
primaryBtn: {
borderRadius: 16,
color: BaseColors.lightBlack,
textAlign:'right',
alignItems: "flex-end",
justifyContent: "flex-end",
alignSelf: "flex-end"
},
btnText: {
color: "#7165e3",
fontFamily: "Quicksand_700Bold",
fontSize: 16
}
}) })