Skip to content

Conversation

@Prathiksha-Nataraja
Copy link
Contributor

Poc on substrate parachain

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
StudentCreated { who: T::AccountId, student_id: u32, student_name: String },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove account id from ebent


#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add marks and average method for student details

let _student = Students::<T>::get(&student_id).ok_or(Error::<T>::StudentNotFound)?;
let average_marks = (internal_marks_1 + internal_marks_2 + internal_marks_3) / 3;

let result = if average_marks >= 40 { "Pass" } else { "Fail" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Student marks no need to store?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants