Write a function to compute the degree to each student


Assignment: Building your package

For this assignment, you will have to build a package. You will be grouped into teams of 4. Each student needs to upload on FASER:
- the archive with the source of the package (the tar.gz file)
- a 1 page document where they explain what their contribution was and how they worked in the team
- the presentation.

Everyone in the group should work on both the code and the presentation. The presentation will be given together as a group with exemplification on how the package works.

If two people worked on a function or the same block of code, please clarify who did what.

Do not forget to add relevant comments for each block of code or function that you write. 30 of the points for each part will be provided for supplying an optimal implementation (it includes comments, formatting, generality, sensible data structures, vectorisation vs for-loops etc.). In other words, if you provide a solution that works, but is not optimal you will not get more than 70 of the points associated with that task.

Description

There are several multiple-choice exams for students in Biological Sciences Department (in the test data we uploaded, we included 5 exams). Each exam has different number of questions, but students will only answer a subset of questions (randomly chosen from that exam). We uploaded eigth files:

- correct_answers_MODULE.dat contains the correct answers for each of the 5 exams.
- number_of_questions.tsv contains the number of questions each student needs to answer for each exam.

- students.tsv the ID of each student and their program ("Biological Sciences" or "Genetics").
- examsPerSubject.tsv a table with whether an exam will be taken by students of the "Biological Sciences" or "Genetics" programs or not.
Your package, should have the following functionality.

a) Generate exam sheets

- write a function generateStudentAnswersForExam which randomly generate answers for questions for a student. The function gets as input moduleID, studentID, totalNumberOfQuestions, numberOfQues- tionsToAnswer, writeToFile. If the last argument is a filename, write the data into that file, otherwise return the data.frame with the answers. The question numbers should be random and students can pottentially answer only to some of their questions. The file/data.frame should have 2 columns (question and answer) and these should be printed in the file. The answers to the questions can be a, b, c, d, e.
- write a function generateAllStudentsAnswersForExam which randomly generate answers for questions for all students taking the exam. The function gets as input the moduleID, num- ber_of_questions (number_of_questions.tsv), allStudentIDs (students.tsv), examsPerSubject (examsPerSubject.tsv) and writeToFile. The function should read this from files. Alternatively, you could write an additional function that receives these as data.frames. If the last argument is TRUE, then write the data into a file for each student, otherwise return a list with data.frames with the answers for each student.

b) Mark exams

- write a function markStudentsForExam(), which takes as input the directory with the correct answers for each exam, the exam files for each student and the name of the exam
- write a function markStudents(), which takes as input the directory with the correct answers for each exam and the exam files for each student.
Hint: You need to convert the number of correct answers to the mark taking into account the number of questions the students had to answer. The mark is an integer between 0 and 100.
- write a function to add a degree to each exam.
- "1st" for marks higher or equal to 70
- "2:1" for marks higher or equal to 60 and lower than 70
- "2:2" for marks higher or equal to 50 and lower than 60
- "3rd" for marks higher or equal to 40 and lower than 50
- "failed" for marks lower than 40

c) Plot results

- write a function to compute the degree to each student based on all their marks (the average over all exams they had to take). If a student failed one exam, they would have failed the year.
- write a function to generate a barplot and/or pie chart with the number/percentage of students that got a certain degree per exam.
- write a function to generate a barplot and/or pie chart with the number/percentage of students that got a certain degree overall.
- write a function to generate a scatterplot between the marks at two exams using only the students that took both exams. On the x-axis you should have marks for exam 1 and on the y-axis marks for exam 2.
- write a function to generate a line plot (with vertical lines) to display the marks ordered decreasingly for each student that took that exam. Use different colours for students studying Biological Sciences and Genetics, but do not use different colours for different marks.

d) Statistical analysis

- write a function to generate a histogram with the marks per exam.
- write a function to generate a histogram with the marks per subject (Biological Sciences or Genetics).
- write a function to perform a statistical analysis to test whether there is difference between the marks of Biological Sciences students and Genetics students for an exam
- write a function to perform a statistical analysis to test whether there is difference between the marks of Biological Sciences students and Genetics students overall

Additional points:

a) Writing manuals

b) Writing the vignette

c) Writing test units

d) Writing additional functions

The last 20 points of this assignment will be given for additional functionality of your package. In particular, we want to see you write new functions, beyond what we asked you to do but related to marking students exams.

Team 1:

- POP, ROMANA TABITA
- GEORGIOU, MERILIN
- LUDLAM, JAMES CHARLES
- ABU, LATIF TOMMIE


Team 2:

- BREZOIU, DAIANA-OANA
- THEOCHAROUS, GEORGIOS
- AKHURST, JENNIFER ELLEN
- CHAN, KHUNG HUAN


Team 3:

- DAVIS, ANDREW MICHAEL
- HADJICONSTANTI, ANDRIANI
- ZAMFIRESCU, ANA-MARIA
- MEHRETEAB, HANNAH TESFAY


Team 4:

- GRECO, ALESSANDRO PIO
- FARIAS GARCIA, PAULA
- MERRITT, RYAN JAMES
- ARALIYA KANKANAMLAGE, HASITHA LAKSHMAN


Team 5:

- BARRETO FRANCISCO, SARA
- GAVRIEL, CHRISTIANA
- PLUMMER, EDEN LAURICE
- HOLLOWAY, CATHAL JOHN


Team 6:

- BASTON, JANE LOUISA
- POVALL, CHELSEA
- ATHANASIOU, PANTELITSA
- RANDALL, TYLER JOHN MICHAEL


Team 7

- IRELEWUYI, OYETADE OLUWAMAYOKUN
- JORDAN, ALEXANDER MORRIS
- LEITHEAD, EMMA MELISSA JOY
- YIANNAKKOS, KONSTANTINOS

Request for Solution File

Ask an Expert for Answer!!
Dissertation: Write a function to compute the degree to each student
Reference No:- TGS02235245

Expected delivery within 24 Hours