Compute the number of correct answers for each student

Assignment Help Other Subject
Reference no: EM131403358

Assignment: Marking exams

For this assignment, create a file called YOURNAME_assignment_01.R, where you will put your solutions.

Description

Students have sat a multiple-choice exam. The exam had 100 questions, and each answer was one of a, b, c, d and e. We supplied a zip file data.zip which contains several files. You will need to first unzip this file. The file correct_answers.dat stores the correct answer for each question (in order), e.g. the fifth entry is the correct answer for question 5. The students had to answer 30 questions from the 100 available questions (each student had a different set of questions to answer) and their answers are stored in files student_ID.tsv. The first column of this file contains the question that is being answered and the second column, their answer.

Your task is to write a script that will mark each student's performance, and produce a data.frame which stores the results.

a) Read the correct answers and store it to a vector called correct_answers. What is the correct answer of question 54?

b) Create a vector with all filenames containing student's answers. The files containing student's answers are called student_ID.tsv.

c) Extract students IDs from the names of the files.

Hint: return a vector of integer numbers with the corresponding ID for each filename.

d) Write a function called markStudent to read a student's answers from the file and return the number of correct answers. How many answers did student 4 get?

Hint: The function should take as arguments the filename with the answers and a vector with the correct answers for all questions.

e) Compute the number of correct answers for each student. How many students got at least 20 correct answers.

f) Compute a mark for each student and store the marks into a vector called marks. Note that a mark is an integer between 0 and 100.

Hint: Each correct answer will weight 3.33 points. Round the mark to the closest integer.

g) Create a data.frame containing the following columns: studentID, filename, correct and mark. Order the data.frame based on student's id.

Export this data.frame to a file called students_marks_YOURNAME.tsv. Do not use quotation marks when writing the text and include in this file the colnames, but not the rownames.

Attachment:- Assignment Files.rar

Reference no: EM131403358

Questions Cloud

Potential difference across capacitor : a. Afterward, what is the charge on each capacitor? Q1, Q2 b. What is the potential difference across each capacitor? delta V1 ,V2
Current in the circuit one time constant : A. Find the charge on the capacitor in the circuit one time constant (τ=RC) after the circuit is connected to a 9.0-V battery. B. Find the current in the circuit one time constant (τ=RC) after the circuit is connected to a 9.0-V battery
How much work was done on the table : A force of 200 N is needed to push a table across a level classroom floor for a distance of 3 m. How much work was done on the table?
New rider change the kinetic energy : A 70.0 kg person is now given a ride on the bicycle (total mass 140.0 kg). How did the addition of the new rider change the kinetic energy at the same speed?
Compute the number of correct answers for each student : Compute the number of correct answers for each student. How many students got at least 20 correct answers. Compute a mark for each student and store the marks into a vector called marks. Note that a mark is an integer between 0 and 100
How high was the load lifted : An electric hoist does 196,000 J of work raising a 250.0 kg load. How high was the load lifted?
When was the last big earthquake along the main fault : When was the last big Earthquake along the main fault? What unlikely feature formed along the fault scarps of Central California? What is an example of this plate movement?
What is kinetic energy in j : A 150 kg baseball has a velocity of 30.0 m/s. What is its kinetic energy in J?
How many watts of power did she developed : A 60.0 kg student runs up a 5.00 m high stairway in a time of 3.92 seconds. How many watts of power did she developed.

Reviews

len1403358

2/22/2017 3:39:03 AM

Do not forget to add relevant comments for each block of code or function that you write. There are 10 points for commenting your code and 10 points for style (indentation, variable names, spacing, line wrapping). Before submitting the assignment, save your file, close (without saving the workspace) and reopen R. Then test that everything works correctly, by running source("YOURNAME_assignment_01.R"). We will mark your solution not your answers. For some questions we provide the answers so you can check you are on the right path.

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd