Coder Social home page Coder Social logo

fhnw_perl-assignment's Introduction

                              $$\          $$$$$$\  $$\                     $$\ 
                              $$ |        $$  __$$\ \__|                    $$ |
 $$$$$$\   $$$$$$\   $$$$$$\  $$ |        $$ /  \__|$$\ $$$$$$$\   $$$$$$\  $$ |
$$  __$$\ $$  __$$\ $$  __$$\ $$ |$$$$$$\ $$$$\     $$ |$$  __$$\  \____$$\ $$ |
$$ /  $$ |$$$$$$$$ |$$ |  \__|$$ |\______|$$  _|    $$ |$$ |  $$ | $$$$$$$ |$$ |
$$ |  $$ |$$   ____|$$ |      $$ |        $$ |      $$ |$$ |  $$ |$$  __$$ |$$ |
$$$$$$$  |\$$$$$$$\ $$ |      $$ |        $$ |      $$ |$$ |  $$ |\$$$$$$$ |$$ |
$$  ____/  \_______|\__|      \__|        \__|      \__|\__|  \__| \_______|\__|
$$ |                                                                            
$$ |                                                                            
\__|                                                            

Final Assignment

Repository for the final project for the FHNW Course: Introduction to Perl for Programmers.
Author: Florian Thiévent

Used Modules from CPAN

  • Text::Levenshtein
  • Statistics::Lite
  • Math::Round The modules can be installed all at once with the script install-modules.sh

Implemented Tasks

Task File Usage Remarks
1a shuffle.pl perl shuffle.pl <path to masterfile as txt> The shuffled file is under ./out. If the directory is missing, the script generates it
1b score_exams.pl perl score_exams.pl <path to masterfile as txt> <list of filled out exams> Exams can be list like exam1/file-*.txt
2 score_examps.pl perl score_exams.pl <path to masterfile as txt> <list of filled out exams> Marked in File where this part is implemented
3 score_examps.pl perl score_exams.pl <path to masterfile as txt> <list of filled out exams> Parts implemented

Function of 1a

  1. load the file from the first cli arg
  2. turn content of file into an array with tie
  3. copy input array to output array, to prevent changing the original
  4. step through output array and searching for a question. a question starts with a digit followed by a period like 1.
  5. If a Question is found, create a new Hash in an array (possible_answers) to store the answers
  6. search for answers. an Answer starts with a [ and must be after a question
  7. if an answer is found, remove the solution marker (x or X) from within the square brackets and add the line index to the possible answers array
  8. Now for all found possible answers, load the slice from the output array, shuffle the slice and write it back to the output array
  9. Create the new filename from current time and date and the input filename
  10. Check if output path exists, if not, create it
  11. create a filehandler to write the content of the output array to a file
  12. write all lines and close the file.

Function of 1b, 2, 3

  1. load the masterfile from the first cli arg
  2. Extract all Questions and the right answers from masterfile
  3. Load an examfile
  4. load all answers to questions from the examfile, if no answer was given, it will be marked with a -
  5. compare the given answers to the correct answers from the masterfile
  6. make the stats and add them to stats array
  7. print out stats

fhnw_perl-assignment's People

Contributors

0x49b avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.