Coder Social home page Coder Social logo

guesswho1234 / rex Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 4.38 MB

Shiny dashboard for creating and evaluating written single and multiple-choice exams.

License: GNU General Public License v3.0

R 25.56% HTML 7.50% JavaScript 59.85% CSS 6.85% Dockerfile 0.24%
multiple-choice quiz single-choice exam latex markdown pdf r scan scrambling sweave test rexams

rex's Introduction

Rex: Shiny R/exams Dashboard Rex logo

This repository provides an interactive shiny dashboard for creating and evaluating written single and multiple-choice exams. The underlying workhorse is R/exams, in particular the so-called NOPS exams functions which support both single-choice and multiple-choice exercises along with automatic evaluation.

Rex is developed by Sebastian Bachler and is still work-in-progress.

Run

Localhost

Install all the necessary R packages (see init.R) including their dependencies.

Start up via shiny::runApp(appDir = 'base directory containing app.R', host = '127.0.0.1', port = 8180); or, alternatively, via RStudio by opening and running app.R.

Heroku

Install the following buildpacks in the following order on your heroku app:

Set the following environment variables (called "Config Vars" on Heroku):

  • INCLUDE_DIR: /app/.dpkg/usr/include/poppler/cpp/
  • LD_LIBRARY_PATH: /app/.dpkg/usr/lib/x86_64-linux-gnu/:/app/R/lib/R/lib:/app/tcltk/lib
  • LIB_DIR: /app/.dpkg/usr/lib/x86_64-linux-gnu/

Deploy this repository to your Heroku app and make sure the web dyno is turned on.

Note

This setup was tested on the "heroku-22" stack.

Note

Heroku shuts down your application if you exceed the memory allocated to your dyno type. If you are using the "Eco" dyno type, the application also shuts down when there is no traffic for 30 minutes.

Warning

While most features of Rex can be used with the low tier dyno types Heroku offers, evaluating exams cannot. Therefore, make sure to switch to high performance dyno types if you wish to evaluate exams with Rex hosted on Heroku.

Docker

Build your image with the supplied docker file: docker build --platform linux/x86_64 -t shiny-docker-rex ..

Run your image: docker run -p 8180:8180 shiny-docker-rex.

Use

Once you got the application running, authenticate using "rex" as both login and password. This then brings you to the main application. At the very top, you will find a navigation bar with the following functionalities:

  • Rex logo (click to get to the top of the page)
  • "EXERCISES" tab where exercises are managed
  • "EXAM" tab where exams are created and evaluated
  • "TOOLS" tab where any additional addons are located
  • "TeX mode" button to enable or disable LaTeX input mode (when turned on, fields where LaTeX is accepted will appear with a pink border)
  • "Hotkeys" button to enable or disable all hotkeys for the application (when hovered, overlays buttons with the corresponding hotkey mapping)
  • Switch for displaying buttons with icons or text
  • Switch to change the application language
  • Heart icon to indicate the application connection status
  • "Log out" button to log out

At the very bottom you find all the information regarding source code and licensing.

Workflow

Manage exercises

The entire management of exercises takes place in the "EXERCISES" tab of the application. For all exercises the app distinguishes between simple editable exercises (highlighted with purple accents) and complex not editable exercises. Based on that, various functionalities are enabled or disabled.

Exercise functionalities:

  • Change seed value used for random processes in complex exercises
  • Create new simple exercise from scratch.
  • Import one or multiple existing simple exercises and complex exercises either as RNW or RMD files
  • Save exercises
  • Convert complex to simple exercises
  • Parse exercises (i.e., check if everything is still fine)
  • Mark exercises as examinable / add them to be considered for the exam
  • Remove exercises
  • Filter exercises
  • Reorder exercises
  • Group exercises into blocks to equally draw from when creating exams

Beyond that, as mentioned above, simple exercise can be edited directly within the application. When editing an exercise, the following fields can be edited:

  • Name
  • Author
  • Type
  • Points
  • Section
  • Question (accepts LaTeX code when "TeX mode" is turned on)
  • Figure
  • Answers (consisting of the solution, text, and a solution note)

Data of fields with a yellow background shade will generally be observable by exam participants. Data of fields without this yellow background shade will never be observable by exam participants. Once a field is edited, the exercise is automatically market with a red warning and, therefore, requires to be parsed again before it can be saved or marked as examinable.

Additionally, on the top right of the exercises tab, summary information on all exercises that are marked as examinable is shown.

Create exams

To create exams, navigate to the "EXAM" tab and further to "Create exam". There you will find one large form with various options to set. The following fields are available in this form:

  • Exam date
  • Seed (used for randomization of exercises, answers s well as random processes within exercises)
  • Number of scramblings
  • number of exercises
  • Fix exercise order
  • Fixed points per exercise
  • Registration number digits
  • Show points
  • Duplex printing
  • Replacement evaluation sheet
  • Avoid wrap in choice list
  • New page per exercise
  • Language
  • Institution
  • Title
  • Course
  • Intro (accepts LaTeX code when "TeX mode" is turned on)
  • Number of blank pages
  • Additional Pdf pages

Input fields that are empty do not require values and are optional. All other fields do require explicit input values and are not optional. While initialized with the value 0, obviously, the "number of exercises" must be greater than 0 in order to be able to create an exam. To set a different number than 0, however, requires exercises to be marked as examinable. In other words, the maximum number of exercises in an exam is the number of exercises marked as examinable.

When pressing the "Create exam" button the exam creation process starts. When this process ends, a popup will show and, given that no errors where encountered, offer to save the exam. When saving the exam, a ZIP archive will be downloaded. In this archive you will find the following files:

  • A PDF file for each scrambling including the evaluation sheet with the institution title, and course text, the intro text, set number of blank pages, and any additionally added PDF pages
  • A HTML file for each scrambling including the solutions and solution notes
  • A RDS file which is needed to evaluate the exam later
  • All of the exercises used in the exam
  • A TXT file "input.txt" containing all the input values used for creating the exam

Evaluate exams

To evaluate exams, navigate to the "EXAM" tab and further to "Evaluate exam". There you will find another large form with various options to set. The following fields are available in this form:

  • Fixed points per exercise
  • Registration number digits
  • Partial points
  • Rule for point deductions
  • Negative points
  • Grade exams
  • Grading key
  • Language
  • Rotate scans
  • Solutions
  • Registered participants
  • Evaluation scans

Input fields that are empty as well as the "Grading key" fields when "Grade exams" is not checked do not require values and are optional. All other fields plus the fields "Solutions", "Registered participants", and "Evaluation scans" do require explicit input values. Specifically:

  • "Solutions": the supplied RDS file in the ZIP archive downloaded when the exam was created
  • "Registered participants": a CSV file containing all the information of participants
  • "Evaluation scans": all the evaluation sheet scans as either PDF or PNG files

When pressing the "Evaluate exam" button the exam evaluation process starts. In a first stage, all the supplied scans are processed. Once this first stage is finished, a popup will show and, given that no errors where encountered, allow to inspect and edit all the scans together with the information extracted from them. When proceeding, the second and last stage starts. Once also this stage is finished, again a popup will show and, given that no errors where encountered, offer to save the exam evaluation. Also, it is possible to revert back to the first stage again. When saving the exam evaluation, a ZIP archive will be downloaded. In this archive you will find the following files:

  • Two ZIP archives, one containing the scans as PNG files matching what was supplied for the "Evaluation scans" field (ending with "_nops_scan.zip") and another containing the evaluation documents of the participants (ending with "_nops_eval.zip"). For each participant the evaluation document is further placed in a separate folder named after what was supplied in the "id" column of the file supplied for the "Registered participants" field
  • Two CSV files, one machting what was supplied for the "Registered participants" field and another containing all the evaluation data (ending with "_nops_eval.csv")
  • One RDS file matching what was supplied for the "Solutions" field
  • A TXT file "statistics.txt" containing some basic evaluation statistics of the exam
  • A TXT file "input.txt" containing all the input values used for evaluating the exam

Addons

Addons add custom functionalities to the application, which do not necessarily tie into the standard workflow described above.

Contribute

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

rex's People

Contributors

guesswho1234 avatar zeileis avatar falk358 avatar

Stargazers

Sebastian Kupek avatar  avatar

Watchers

 avatar

Forkers

zeileis s-kupek

rex's Issues

Restructure exam evaluation

  • Display daten.txt and highlight scans with problems or where no matching id was found in the uploaded file with registered participants
  • Clicking on lines (from daten.txt) allows editing of individual evaluations (side by side view of scanned image and a html representation of the evaluation sheet)
  • Finalizing passes / creates / updates all files for nops_eval (daten.txt, png scans, registered participants, solutions)

Export task

exporting task sometimes gives htm file instead of rnw

Fix languages on heroku

On heroku latex throws an error if something other than "en", "ja", "ko", "tr" is selected for the language when creating an exam

Export all tasks

Download fires infinitely when a click on the download button is simulated.

multiuser compatibility

  • avoid sessions interfering with each other
  • sometimes directories are not unlinked properly

Improve IuF tasks

Add:

  • library(exams)
  • library(iuftools)

Replace if(MAKEBSP) set.seed(1) to if(exists(MAKEBSP) && MAKEBSP) set.seed(1)

Remove question type field from task view

remove field from gui, but keep it in object model. also only allow tasks with "mchoice" to be added to the list in the first place. if not "mchoice" display error.

Properly close file connections

  • Unlink all files when not needed anymore
  • Maybe even on.exit(unlink(...)) right after tempdir() or tmpfile()?
  • Or unlink all at the end?

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.