Connect with users of Wolfram technologies to learn, solve problems and share ideas
Mark as an Answer
1 Total Likes
Follow this post
Share this post:
Import and Export
Test Scoring Application
10 years ago
I have an assignment where I have to create a code to check over a group of students choices for a mock test and determine if the value is correct and return a score for the students and determine if they pass or not.
"Write a Mathematica program to correct the Permit test for the DMV. The program should read a list of names and answers and compare them to the correct answers. The student scores should be imported from the file student. The correct answers are stored in the file correct. If the student gets at least 7 correct answers, he/she passes the test. The program should print out the student name, number of correct answers, score and Pass/Fail.
EX: Sally Smith 8 correct questions 80 PASS
You will need to import both files into your program."
How would I attempt to do this I am extremely stumped on the whole thing anyone have some input?
C ormullion, I belong to no organization.
10 years ago
Well, obviously it's your assignment, and you're presumably able to do this to some extent (otherwise you went into the wrong classroom
), so we can't be of too much help. But here are a few suggestions:
1. Break the task down into smaller steps. Then you can only be stumped on 'the next step', rather than the whole thing.
2. Learn the basics of Mathematica. So visit YouTube, or www.wolfram.com/broadcast and watch a few videos. Read the Virtual Book in the Mathematica help or some of the tutorials.
3. Find out how to import files. Seaching for 'import' will bear much fruit. You have to know the file format of the files "student" and "correct" - tab-separated, comma-separated, or what? You could probably import the names and scores into a table - a list of lists.
4. A basic skill in Mathematica is to chop and slice lists. Use double brackets (aka Part) for list access. You can get columns from tables too.
5. Write a function that takes two lists, one containing a student's scores, the other containing the answers. Find out how to compare two lists. This might involve...
6. Finding out how to map a function over one or more lists. This could be useful for comparing the values and storing some results. MapThread is cool...
7. Comparing a student's answer against the real answer is easy if the answers are numbers. Multiple choice is OK too. Otherwise you'll have to know about comparing strings...
8. The Count function can count values in lists. If the Count of correct answers is greater than or equal to 7, the student passes.
It's not a lot of code (about 10-20 lines?) but if you haven't learnt the basics of the language, it might be quite challenging until you have.
Reply to this discussion
in reply to
Community posts can be styled and formatted using the
Tag limit exceeded
Note: Only the first five people you tag will receive an email notification; the other tagged names will appear as links to their profiles.
Add a file to this post
Follow this discussion
Be respectful. Review our
to understand your role and responsibilities.
Wolfram|Alpha Notebook Edition
Volume & Site Licensing
Enterprise Private Cloud
Service Plans Benefits
Wolfram Language Documentation
Wolfram Language Introductory Book
Get Started with Wolfram
Fast Introduction for Programmers
Fast Introduction for Math Students
Webinars & Training
Connected Devices Project
Wolfram Data Drop
Wolfram + Raspberry Pi
. All rights reserved.
Learn how »