Skip to content
This repository has been archived by the owner on Apr 21, 2020. It is now read-only.

Exercises

Boris Arkenaar edited this page May 1, 2015 · 3 revisions

Overview

You will see a list of exercises with links to the page for each them on which you can find out all about the exrcise and submit your solution to it.

Exercises

For tutors an edit icon is also visible which will bring them to the page for editing an exercise. Besides that thoy have the option to create a new exercise.

Detail

The detail page for an exercise provides all the information about an exercise a student needs. A text editor is available for the student to enter their solution to the exercise.

Submitting

When submitting a solution to an exercise it will be checked on various points and feedback will be provided to the student on the outcome of those checks. The different checks that will be performed are syntax, format, functionality and maintainability. They will be performed in series in the order mentioned. Depending of the outcome of one check, the following will or will not be executed.

Problems with syntax and format of the solution will displayed as red exclamation marks to the left of the line in question of the solution code. When you hover your mouse over the exclamation mark a description of the problem will be shown along with the line and column number of where in the solution the problem occurs.

Syntax

The Javascript Examiner will perform a syntax check before all other checks to make sure syntactically correct Javascript has been provided. If the syntax is correct the next checks will be executed. If the syntax does not seem to be correct the student will be notified about the line and column number in the solution where a syntax error occurs and a description of the syntax error.

Any subsequent check will not be performed if there are syntax error, because they require valid Javascript code.

Format

This check will make sure the supplied code will adhere to a certain standard of formatting the code. The Javascript Examiner can be configured on the formatting rules it uses.

The following checks could be executed with incorrectly formatted code, but to enforce the student to adhere to the formatting rules, the student will need to satisfy this check before continuing on the next steps.

Functionality

To validate the proper functionality of the solution it will be tested with a test suite provided by the tutor. The results of executing the test suite will be displayed below the text editor. In case of a failing test reason for failing will be shown, along with an optional description of the tutor.

Functionality check failed

All the tests in the test suite need to be passed. Only then will it be useful to say something about the maintainability of the solution code.

Maintainability

This check will calculate some maintainability metrics. It will show the maintainability score of the solution, along with the cyclomatic density (which is the cyclomatic complexity relative to the amount of lines of code). For each function in the solution the cyclomatic density will be displayed as well. These results can be compared to the results of this check on the solution provided by the tutor. All this information will be displayed below the text editor (below the results of the functionality check).

Maintainability check results

Managing

The tutor has the ability to edit existing exercises and create new ones. For each exercise a name and a description can be provided. Besides that the tutor can specify the API required for an exercise through a set of functions, a model solution to the exercise, and a test suite that tests the functionality of a provided solution.

Functions

Functions

The API each solution for an exercise should provide can be configured by specifying a set of functions the solution should expose. Each function has a name and can have multiple arguments. Each argument has a type, a name and a description. The format used is conform JSdoc. All possible types are listed in their documentation.

Model solution

The model solution can serve as a reminder for the tutor what a correct solution would look like. The model solution will not be exposed to the student. The model soluiton also serves as a reference for the maintainability metrics.

All checks that are performed on the solution of the student will also be performed on the model solution before saving the exercise. The syntax and format checks will prevent the exercise from being saved if they find any problems. Any problems will be shown in the same maner as they are shown to the student.

After those two checks succeed the functionality check will be performed using the test suite provided below the model solution (described below on this wiki page).

Finally the maintainability check will be executed on the model solution. The student will be able to compare the metrics of his code to the metrics of the model solution.

Test suite

The tutor can provide a test suite to be used by the functionality check. The Javascript Examiner uses mocha for running the tests and chai for describing the tests. Tests can be ordered by using describe and it blocks. Assertions can be done in three different maners; assert, expect, and should. The solution code will be exposed through the variable studentCode.

Before saving the exercise the test suite will be executed on the model solution provided. The results of the tests will be displayed below the test suite. The exercise will be saved no matter the outcome of the tests.

Clone this wiki locally