Skip to content

Completed the assignment no 1#1

Open
HarisButt090 wants to merge 1 commit into
Staunchglobal:masterfrom
HarisButt090:haris/v1/ror_ase_assignment_1
Open

Completed the assignment no 1#1
HarisButt090 wants to merge 1 commit into
Staunchglobal:masterfrom
HarisButt090:haris/v1/ror_ase_assignment_1

Conversation

@HarisButt090
Copy link
Copy Markdown

Description

This pull request introduces the main lms.rb file, which includes the core functionality for the LMS (Learning Management System). Additionally, it includes:

  1. CSV files containing data generated for students and subjects.
  2. PDF files generated as part of the report for students.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated PDF files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated PDF files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated PDF files

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated PDF files

Comment thread students_data.csv
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated CSV files

Comment thread subjects_data.csv
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't include the generated CSV files

Comment thread lms.rb
# then defined conditions for each option and called the function of LMS by passing its instance in the function.
case option
when "1"
puts "Enter your id"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also should make small function against each option case to increase the readability
Refcator repeated code by making its function.

def fetch_student_input
    puts "Enter student ID:"
    gets.chomp.to_i
  end

Comment thread lms.rb
subject_name=line['subject_name']
score=line['score'].to_i
if @students[student_id]
subject=Subject.new(student_id,subject_name,score)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

kindly add indentation

Comment thread lms.rb
end
#this function checks wheter that astudent exists or not and return its instance to get related data for user.
def find_student(id)
@students[id]? @students[id] : nil
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The method should raise an error message if the ID isn't found, so that whenever this method is called, it will raise an error indicating that the specific student was not found."

Comment thread lms.rb
score=line['score'].to_i
if @students[student_id]
subject=Subject.new(student_id,subject_name,score)
@students[student_id].add_subject(subject)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to raise an error or implement functionality if the student ID is not present in the @Students hash.

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