https://github.com/ambco-iscte/jask

A Library for Generating Questions about Learners' Code in Java

https://github.com/ambco-iscte/jask

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: acm.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.2%) to scientific vocabulary

Keywords

educational educational-software java qlc qlcs question-generation questions-generation
Last synced: 5 months ago · JSON representation

Repository

A Library for Generating Questions about Learners' Code in Java

Basic Info
  • Host: GitHub
  • Owner: ambco-iscte
  • Language: Kotlin
  • Default Branch: master
  • Homepage:
  • Size: 558 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 3
  • Releases: 0
Topics
educational educational-software java qlc qlcs question-generation questions-generation
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme

README.md

Jask

**A Library for Generating Questions about Learners' Code in Java** [What is Jask?](#ⓘ-what-is-jask) • [Question Types](#-question-types) • [Examples](#-examples)



ⓘ What is Jask?

Jask is a library for generating Questions about Learners' Code (QLCs) targeting Java code. Jask aims to reframe previous work on QLCs as a library which can be integrated into existing educational programming environments to promote program comprehension.

Jask provides question templates which can be applied to snippets of Java code to generate concrete questions targeting that code.


🤔 Question Types

Structural (pt.iscte.jask.templates.structural)

Structural QLCs target structural/static aspects of code.

Dynamic (pt.iscte.jask.templates.dynamic)

Dynamic QLCs target dynamic aspects of the code's execution.

Quality (pt.iscte.jask.templates.quality)

Quality QLCs target anti-patterns and code refactor opportunities. The aim of these QLCs is to provide students with an an opportunity to reflect about how the quality of their code could be improved.

Errors (pt.iscte.jask.errors)

Error QLCs target compiler and runtime errors. The aim of these QLCs is to provide students with an opportunity to reflect critically about their code's errors.


👉 Examples

Structural QLC

```kotlin val src = """ class Test { static double average(int a, int b) { double n = 2.0; return (a + b) / n; }
} """

val qlc = HowManyVariables().generate(src) println(qlc)

How many variables (not including parameters) does the function [average] have?

static double average(int a, int b) { double n = 2.0; return (a + b) / n;

}

[ ] 2 [ ] 3 [x] 1 [ ] 4 ```

Dynamic QLC

```kotlin val src = """ class Test { static double abs(double n) { if (n < 0) return -n; else return n; } } """.trimIndent()

val qlc = WhichReturnExecuted().generate(src, ProcedureCall( id = "abs", arguments = listOf(-2.0) ))

Which return statement (line) executed when calling [abs(-2.0)]?

static double abs(double n) { if (n < 0) return -n; else return n;

}

[x] Line 3 [ ] Line 5 ```

Runtime Error QLC

```kotlin val src = """ class ArrayUtils { static int sum(int[] a) { int s = 0; for (int i = 0; i <= a.length; i++) s += a[i]; return s; } } """.trimIndent()

val (result, qlcs) = QLCVirtualMachine(src).execute("sum", listOf(1, 2, 3, 4, 5))

qlcs.forEach { println(it) } The function call [sum([1, 2, 3, 4, 5])] threw an ArrayIndexOutOfBounds

exception at line 4: the index [5] is invalid for the array [a].

static int sum(int[] a) { int s = 0; for (int i = 0; i <= a.length; i++) { s = s + a[i]; } return s;

}

Which is the length of the array [a]? [ ] 4 [ ] 0 [ ] 6 [x] 5

Which is the last valid index of the array [a]? [ ] 3 [ ] 5 [x] 4 [ ] 0

Which variable is being used to access the array [a]? [ ] s [x] i [ ] a [ ] None of the above.

Which is the sequence of values taken by the variable [i] when calling [sum([1, 2, 3, 4, 5])]? [x] 0, 1, 2, 3, 4, 5 [ ] 1, 2, 3, 4, 5 [ ] 1, 3, 6, 10, 15 [ ] 0, 1, 2, 3, 4 ```


🔠 Translating Jask

Jask provides a localisation module which allows developers to translate the content of questions into any language. The localisation module relies on language files present in the resources folder.

Each language files contains a set of key-value pairs corresponding to the different localisabe elements in Jask. In the translations %s is used to denote a value that will be filled in (automatically!) by Jask when using that translation.

If you want to add a new language and make it available in Jask, feel free to make a pull request with your own language files! You can add these to the initblock of the initialisation module. Otherwise, a language can be loaded from any .properties file using Localisation.register(File("path/to/file.properties")).


📝 Publications Using Jask


© Credit

Owner

  • Name: Afonso Caniço
  • Login: ambco-iscte
  • Kind: user
  • Location: Lisbon, Portugal
  • Company: Iscte - University Institute of Lisbon

Master's Student & Invited Teaching Assistant @ Iscte-IUL

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Dependencies

build.gradle.kts maven
  • org.jetbrains.kotlin:kotlin-test * testImplementation