Merge pull request 'bug fixes psychometic' (#8) from update-existing-code into development
Reviewed-on: WizdomWaves/TedQuMobileApp#8
This commit is contained in:
commit
5c2438fb79
|
@ -150,7 +150,7 @@ export const MONTHLIST = [
|
|||
numberPatten: /^\d{10}$/,
|
||||
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
|
||||
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
|
||||
address: /^\S+(?: \S+)*$/, //NOSONAR
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ export const passwordStrengthValidator = (password:any) => {
|
|||
return 'Password cannot be empty.'
|
||||
}
|
||||
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 ''
|
||||
|
|
|
@ -21,6 +21,8 @@ import TeacherUpdate from '@screens/Teacher/TeacherUpdate' //NOSONAR
|
|||
import TeacherInfo from '@screens/Teacher/TeacherInfo' //NOSONAR
|
||||
import TeacherAttendance from "@screens/Teacher/TeacherAttendance" //NOSONAR
|
||||
import HomePsychometric from "@screens/Pscyometric/HomePsychometric"
|
||||
import StudentListPsychometric from "@screens/Pscyometric/StudentListPsychometric"
|
||||
|
||||
import Greetings from "@screens/Greetings" //NOSONAR
|
||||
|
||||
const Drawer = createDrawerNavigator();
|
||||
|
@ -78,7 +80,7 @@ const DrawerNavigator = () => {
|
|||
<Drawer.Screen name="SchoolUpdate" component={SchoolUpdate} />
|
||||
<Drawer.Screen name="Class" component={ClassStackNavigator} />
|
||||
<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="ClassUpdate" component={ClasslUpdate} /> */}
|
||||
<Drawer.Screen name="TeacherView" component={TeeacherStackNavigator} />
|
||||
|
|
|
@ -50,6 +50,11 @@ export const homestudy = (state = defaultState, action: any) => {
|
|||
case GET_HOME_STUDY_LIST_FAILURE:
|
||||
return { ...state, loading: false, error: action.error }
|
||||
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 }
|
||||
case GET_HOME_STUDY_TRANSACTION_DETAILS_SUCCESS:
|
||||
return { ...state, loading: false, home_study_details: response }
|
||||
|
|
|
@ -190,7 +190,10 @@ class CreatePassword extends React.Component<any, any>{
|
|||
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 uppercase</Text>
|
||||
</View>
|
||||
<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>
|
||||
</View>
|
||||
<View style={AuthStyles.passwordContainer}>
|
||||
<Text style={AuthStyles.passwordStrength}><Text style={AuthStyles.passwordList}>. </Text>1 Symbol</Text>
|
||||
</View>
|
||||
<TouchableOpacity style={BaseStyles.loginBtn} onPress={this.onSetPassWord.bind(this)} disabled={this.props.loading} activeOpacity={0.8}>
|
||||
|
|
|
@ -203,6 +203,7 @@ class HomeStudyGenerateQuestions extends React.Component<any, any>{
|
|||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
{this.props.homestudyLoading && <ActivityIndicator size="large" color="#7165e3" />}
|
||||
</ScrollView>
|
||||
</View>
|
||||
)}
|
||||
|
@ -240,6 +241,7 @@ const styles = StyleSheet.create({
|
|||
const mapStateToProps = (state: any) => ({
|
||||
loading: state.questionbank.loading,
|
||||
isLoading: state.students.loading,
|
||||
homestudyLoading: state.homestudy.loading,
|
||||
blueprintSubject: state.questionbank.bluprint_subject_dropdown,
|
||||
blueprintLesson: state.questionbank.bluprint_lesson_dropdown,
|
||||
records: state.questionbank.assessmentrecords,
|
||||
|
|
|
@ -93,7 +93,7 @@ class QuestionScreen extends React.Component<any, any>{
|
|||
})
|
||||
}
|
||||
handleBack = async () => {
|
||||
|
||||
await this.props.getPsychometricStudentDropdownByClass({ token: this.token, academic_year: this.state.academicYear.toString() })
|
||||
this.props.navigation.navigate("Pscyometric")
|
||||
}
|
||||
handleNext = async () => {
|
||||
|
@ -413,6 +413,9 @@ const mapDispatchToProps = (dispatch: any) => ({
|
|||
getPsychometricCasheAnswer: (user: any) => {
|
||||
dispatch(ActionCreators.getPsychometricCasheAnswer(user))
|
||||
},
|
||||
getPsychometricStudentDropdownByClass: (user: any) => {
|
||||
dispatch(ActionCreators.getPsychometricStudentDropdownByClass(user))
|
||||
},
|
||||
})
|
||||
|
||||
QuestionScreen.propTypes = {
|
||||
|
|
|
@ -257,6 +257,7 @@ class ReportPsychometric extends React.Component<any, any>{
|
|||
position: 'BOTTOM',
|
||||
labelRotationAngle: -60, // Rotate the labels to make them vertical
|
||||
drawLabels: true,
|
||||
textColor: processColor('#282313'),
|
||||
}}
|
||||
yAxis={{
|
||||
left: {
|
||||
|
@ -265,6 +266,7 @@ class ReportPsychometric extends React.Component<any, any>{
|
|||
},
|
||||
right: {
|
||||
enabled: true,
|
||||
textColor: processColor('#282313'),
|
||||
},
|
||||
}}
|
||||
animation={{ durationX: 1000 }}
|
||||
|
|
|
@ -25,7 +25,8 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
scrollView: any;
|
||||
token: any;
|
||||
state: any = {
|
||||
academicYear: ''
|
||||
academicYear: '',
|
||||
parent:false
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
|
@ -41,7 +42,16 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
const userInfo = await AsyncStorage.getItem('userInfo')
|
||||
|
||||
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
|
||||
this.props.getPsychometricStudentDropdownByClass({ token: this.token, academic_year: this.state.academicYear.toString(), class_id: dataParams.id })
|
||||
} else {
|
||||
|
@ -90,6 +100,10 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
}
|
||||
}
|
||||
|
||||
toClass = () => {
|
||||
this.props.navigation.navigate("ClassListPsychometric")
|
||||
}
|
||||
|
||||
renderRow = ({ item }: any) => (
|
||||
<TouchableOpacity style={[BaseStyles.padHorizontal10, AppStyles.CardView, AppStyles.studentCard]} onPress={this.toQuizScreen.bind(this, item)}
|
||||
activeOpacity={0.8}>
|
||||
|
@ -118,13 +132,16 @@ class StudentListPsychometric extends React.Component<any, any>{
|
|||
|
||||
render() {
|
||||
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
|
||||
label = dataParams.grade_standard
|
||||
}
|
||||
|
||||
return (<View style={[AppStyles.containerWoPadding, {}]}>
|
||||
<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
|
||||
style={{ marginVertical: 12, marginHorizontal: 16 }}
|
||||
data={this.props.studentList}
|
||||
|
@ -157,6 +174,19 @@ const styles = StyleSheet.create({
|
|||
backgroundColor: BaseColors.danger,
|
||||
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
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue