bug fixes artag redirect and psychometric

This commit is contained in:
vinoth 2024-12-04 09:48:20 +05:30
parent af6b82017c
commit f3b3b6495f
8 changed files with 32 additions and 18 deletions

View File

@ -72,7 +72,7 @@ const AdminTabNavigator = ({route, navigation} : any) => {
options={{ options={{
tabBarLabel: 'Instant Feedback', tabBarLabel: 'Instant Feedback',
}}/> }}/>
<Tab.Screen name="AttendanceView" component={AttendanceView} initialParams={route.params} options={{ tabBarLabel: 'Attendances'}} /> <Tab.Screen name="AttendanceView" component={AttendanceView} initialParams={route.params} options={{ tabBarLabel: 'Attendance'}} />
<Tab.Screen name="schoolCalendar" component={SchoolCalendar} initialParams={route.params} options={{ tabBarLabel: 'Calendar'}} /> <Tab.Screen name="schoolCalendar" component={SchoolCalendar} initialParams={route.params} options={{ tabBarLabel: 'Calendar'}} />
<Tab.Screen name="Diary" component={DiaryView} initialParams={route.params} options={{ tabBarLabel: 'Diary'}} /> <Tab.Screen name="Diary" component={DiaryView} initialParams={route.params} options={{ tabBarLabel: 'Diary'}} />
<Tab.Screen name="NoticeBoard" component={NoticeBoardView} initialParams={route.params} options={{ tabBarLabel: 'Notice Board'}} /> <Tab.Screen name="NoticeBoard" component={NoticeBoardView} initialParams={route.params} options={{ tabBarLabel: 'Notice Board'}} />

View File

@ -123,7 +123,7 @@ const ParentTabNavigator = ({route, navigation} : any) => {
})} })}
> >
<Tab.Screen name="studentProfile" component={StudentProfile} initialParams={route.params} options={{ tabBarLabel: 'Profile'}}/> <Tab.Screen name="studentProfile" component={StudentProfile} initialParams={route.params} options={{ tabBarLabel: 'Profile'}}/>
<Tab.Screen name="studentAttendance" component={StudentAttendanceView} initialParams={route.params} options={{ tabBarLabel: 'Attendances'}}/> <Tab.Screen name="studentAttendance" component={StudentAttendanceView} initialParams={route.params} options={{ tabBarLabel: 'Attendance'}}/>
<Tab.Screen name="schoolCalendar" component={SchoolCalendar} initialParams={route.params} options={{ tabBarLabel: 'Calendar'}} /> <Tab.Screen name="schoolCalendar" component={SchoolCalendar} initialParams={route.params} options={{ tabBarLabel: 'Calendar'}} />
<Tab.Screen name="studentDiary" component={DiaryView} initialParams={route.params} options={{ tabBarLabel: 'Diary'}} /> <Tab.Screen name="studentDiary" component={DiaryView} initialParams={route.params} options={{ tabBarLabel: 'Diary'}} />
<Tab.Screen name="studentNoticeBoard" component={NoticeBoardView} initialParams={route.params} options={{ tabBarLabel: 'Notice Board'}} /> <Tab.Screen name="studentNoticeBoard" component={NoticeBoardView} initialParams={route.params} options={{ tabBarLabel: 'Notice Board'}} />

View File

@ -48,7 +48,7 @@ export const questionbank = (state = defaultState, action: any) => {
const response = action.data const response = action.data
switch (action.type) { switch (action.type) {
case INIT_ASSESSMENT_MODULE: case INIT_ASSESSMENT_MODULE:
return { ...state, loading: true, license: defaultObj, assessment_create: {}, assessment_update: {}, assessment_answer: {}, question_details:[], assessment_student_list:{} } return { ...state, loading: true, license: defaultObj, assessment_create: {}, assessment_update: {}, assessment_answer: {}, question_details:[]}
case GET_QUESTION_PAPER_PAGINATION_REQUEST: case GET_QUESTION_PAPER_PAGINATION_REQUEST:
case GET_ASSESSMENT_PAGINATION_REQUEST: case GET_ASSESSMENT_PAGINATION_REQUEST:
case GET_QUESTION_PAPER_REQUEST: case GET_QUESTION_PAPER_REQUEST:

View File

@ -105,7 +105,10 @@ class ArTagScanner extends React.Component<any, any>{
this.props.initAttendance({}) this.props.initAttendance({})
this.fetchAttendanceDetailList() this.fetchAttendanceDetailList()
this.fetchAdminDashboardList() this.fetchAdminDashboardList()
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo) setTimeout(() => {
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo)
}, 2000);
} }
} }
/** InstantFeedback Created Action Trigger */ /** InstantFeedback Created Action Trigger */
@ -113,7 +116,9 @@ class ArTagScanner extends React.Component<any, any>{
if (this.props.instantFeedbackData.status) { if (this.props.instantFeedbackData.status) {
this.props.initInstantFeedback({}) this.props.initInstantFeedback({})
this.fetchInstantFeedbackDetailList() this.fetchInstantFeedbackDetailList()
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo) setTimeout(() => {
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo)
}, 2000);
} }
} }
@ -122,7 +127,9 @@ class ArTagScanner extends React.Component<any, any>{
if (this.props.quizData.status) { if (this.props.quizData.status) {
this.props.initTakeQuizzes({}) this.props.initTakeQuizzes({})
this.fetchQuizzesDetailList() this.fetchQuizzesDetailList()
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo) setTimeout(() => {
this.redirectToRouteBack(this.props.route.params.isHome, this.props.route.params.routeTo)
}, 2000);
} }
} }
} }

View File

@ -27,7 +27,7 @@ class AttendanceView extends React.Component<any, any>{
async componentDidMount() { async componentDidMount() {
const { navigation, route } = this.props; const { navigation, route } = this.props;
const title = 'Attendances'; const title = 'Attendance';
navigation.setOptions({ title }); navigation.setOptions({ title });
this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response this.getCurrentAcademicYearData() //fetch the Current Academic year from Login Response
this.token = await AsyncStorage.getItem('token') this.token = await AsyncStorage.getItem('token')
@ -104,7 +104,7 @@ class AttendanceView extends React.Component<any, any>{
if (studentList) { if (studentList) {
if (studentList.length) { if (studentList.length) {
this.props.navigation.navigate('ArTagScanner', { this.props.navigation.navigate('ArTagScanner', {
class_info: classDataInfo, action: common.attendance, students: studentList, isHome: false, routeTo: "AttendanceView", label: "Attendances" class_info: classDataInfo, action: common.attendance, students: studentList, isHome: false, routeTo: "AttendanceView", label: "Attendance"
}) })
} else { } else {
Toast.show("No Students Present In this Class", Toast.SHORT) Toast.show("No Students Present In this Class", Toast.SHORT)

View File

@ -311,7 +311,7 @@ class DiaryView extends React.PureComponent<any, any> {
</View>} </View>}
<View style={[{ flex: 1, flexDirection: 'row' }]}> <View style={[{ flex: 1, flexDirection: 'row' }]}>
<View style={[BaseStyles.padHorizontal10, AppStyles.DiaryReplyView, BaseStyles.marTop10, BaseStyles.marLeft10]} > <View style={[BaseStyles.padHorizontal10, AppStyles.DiaryReplyView, BaseStyles.marTop10, BaseStyles.marLeft10]} >
<TextInput style={[AppStyles.DiaryReplyText, { height: 30 }]} keyboardType="default" placeholder="Enter your reply" multiline={true} editable={true} <TextInput style={[AppStyles.DiaryReplyText, { height: 40 }]} keyboardType="default" placeholder="Enter your reply" multiline={true} editable={true}
onChangeText={replyText => this.setState({ reply: replyText })} /> onChangeText={replyText => this.setState({ reply: replyText })} />
</View> </View>
<View style={[{ alignItems: 'center', justifyContent: 'center' }]}> <View style={[{ alignItems: 'center', justifyContent: 'center' }]}>

View File

@ -107,7 +107,7 @@ class ReportPsychometric extends React.Component<any, any>{
config: { config: {
colors: processedColors, colors: processedColors,
valueTextSize: 10, // Increase the font size for the values valueTextSize: 10, // Increase the font size for the values
// valueFormatter: "###.###'%'", valueFormatter: "###.##", //"###.###'%'"
valueTextColor: processColor('#282313'), valueTextColor: processColor('#282313'),
}, },
}, },

View File

@ -20,15 +20,22 @@ const validationSchema = yup.object().shape({
.string() .string()
.min(3, ({ min }) => `The Question Name must be at least ${min} characters`) .min(3, ({ min }) => `The Question Name must be at least ${min} characters`)
.max(50, ({ max }) => `The Question Name cannot be more than ${max} characters`) .max(50, ({ max }) => `The Question Name cannot be more than ${max} characters`)
.required('Question Name is required'), .required('Question Name is required')
questions: yup .test('questions-required', 'You must add at least one question', function (value) {
const { questions } = this.parent;
if (questions && questions.length === 0) {
return this.createError({ message: 'You must add at least one question' });
}
return true;
}),
questions: yup
.array() .array()
.of( .of(
yup.object().shape({ yup.object().shape({
question: yup.string().required('Question is required'), question: yup.string().required('Question is required'),
topics: yup.string() topics: yup.string()
.max(30, ({ max }) => `Topics cannot more than ${max} characters`) .max(30, ({ max }) => `Topics cannot be more than ${max} characters`)
.required('Topics is required'), .required('Topics is required'),
choosen: yup.string().required('Choose the correct Answer'), choosen: yup.string().required('Choose the correct Answer'),
answers: yup.array().of( answers: yup.array().of(
yup.object().shape({ yup.object().shape({
@ -39,7 +46,7 @@ const validationSchema = yup.object().shape({
) )
.min(1, 'You need at least one question') .min(1, 'You need at least one question')
.required('Question is required'), .required('Question is required'),
}) });
const initialQuestionValue: any = { const initialQuestionValue: any = {
serial_no: '', serial_no: '',
@ -275,7 +282,7 @@ class QuestionSetCreate extends React.Component<any, any>{
<View > <View >
{values.questions.length > 0 && {values.questions.length > 0 &&
values.questions.map((question: any, index: any) => ( values.questions.map((question: any, index: any) => (
<View style={[BaseStyles.padding10,BaseStyles.marVertical15,BaseStyles.padBottom20,{backgroundColor:BaseColors.muted,borderRadius:10}]} key={index}> <View style={[BaseStyles.padding10,BaseStyles.marTop15,BaseStyles.padBottom20,{backgroundColor:BaseColors.muted,borderRadius:10}]} key={index}>
<View style={[BaseStyles.flexRow,BaseStyles.justifySpaceBetween,BaseStyles.marBottom10,{flex:1}]}> <View style={[BaseStyles.flexRow,BaseStyles.justifySpaceBetween,BaseStyles.marBottom10,{flex:1}]}>
<Text style={[BaseStyles.font700Bold,BaseStyles.font16]}>Questions : {index + 1}</Text> <Text style={[BaseStyles.font700Bold,BaseStyles.font16]}>Questions : {index + 1}</Text>
<TouchableOpacity <TouchableOpacity
@ -381,7 +388,7 @@ class QuestionSetCreate extends React.Component<any, any>{
} }
/> />
</View> </View>
<View style={{ flexDirection: 'column-reverse', width:'85%' }}> <View style={{ flexDirection: 'column', width:'85%' }}>
<View style={[AppStyles.inputView, BaseStyles.marTop15,]}> <View style={[AppStyles.inputView, BaseStyles.marTop15,]}>
<TextInput style={AppStyles.inputText} <TextInput style={AppStyles.inputText}
@ -442,7 +449,7 @@ class QuestionSetCreate extends React.Component<any, any>{
</View> </View>
))} ))}
<TouchableOpacity <TouchableOpacity
style={[styles.btnRound,{backgroundColor:BaseColors.mainColor, alignSelf:'center'}]} activeOpacity={0.8} style={[styles.btnRound, BaseStyles.marTop15, {backgroundColor:BaseColors.mainColor, alignSelf:'center'}]} activeOpacity={0.8}
onPress={this.onAddNewRow.bind(this, push)}> onPress={this.onAddNewRow.bind(this, push)}>
<FontAwesome name="plus" size={18} style={[styles.icon, { paddingLeft: 8, fontWeight: 'bold' }]} /> <FontAwesome name="plus" size={18} style={[styles.icon, { paddingLeft: 8, fontWeight: 'bold' }]} />
</TouchableOpacity> </TouchableOpacity>