https://github.com/connor-makowski/x_rand

Randomization for EdX

https://github.com/connor-makowski/x_rand

Science Score: 36.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
  • Academic publication links
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary

Keywords from Contributors

labels
Last synced: 10 months ago · JSON representation

Repository

Randomization for EdX

Basic Info
  • Host: GitHub
  • Owner: connor-makowski
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 148 KB
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • Open Issues: 6
  • Releases: 0
Created over 6 years ago · Last pushed over 3 years ago
Metadata Files
Readme License

README

# x_rand
Randomization package for [edX] courses

## Features

- Users can:
  - Randomize mathematical problems on edX
  - Randomize multiple choice problems on edX
  - Randomize checkbox problems on edX

## API Documentation
The [full api documentation](https://connor-makowski.github.io/x_rand/x_rand.html) can be found [here](https://connor-makowski.github.io/x_rand/x_rand.html).

### Installation For use in edX
Upload the `python_lib.zip` file to your edX course.
  - WARNING: This will overwrite your current `python_lib.zip` if you already have it.
  - NOTE: If you already have a `python_lib.zip`, you can add the x_rand.py file from `python_lib` directly to your `python_lib` folder, re-zip it and re-upload it.


### Installation For testing and admin use
Make sure you have Python 3.x.x (or higher) installed on your system. You can download it from [python].

```
pip install x_rand
```


### Example Random mathematical problem
1) Initialize an `x_rand` variable with the current student AID:
- Note you should always set a random `upseed` (integer) for each problem
  ```
  x=x_rand(anonymous_student_id, upseed=28)
  ```

2) Input data:
  ```
  data=[
    ['a','b'],
    [1,2],
    [2,4]
  ]
  ```

3) To use the variables in edX problems, you have to create relevant variables and make them global:
  - To do this use the `globals().update()` function
  - Then randomly select a row out of that data
  ```
  globals().update(x.select_random(data))
  ```
  - Note: Column headers from your data are now available to be called as variables globally. If the first row of data was selected:
  ```
  print (a)
  > 1
  print (b)
  > 2
  ```

4) These can be called into edX scripts as `$a` and `$b` respectively. An example `Blank Advanced Problem` script is below:
```




Enter your answer below.




```


### Example Random multiple choice or checkbox problem
1) Initialize an `x_rand` variable with the current student AID:
- Note you should always set a random `upseed` (integer) for each problem
  ```
  x=x_rand(anonymous_student_id, upseed=99)
  ```

2) Input data:
  ```
  data = [
    ["text", "correct"],
    ["A", "True"],
    ["B", "True"],
    ["1", "False"],
    ["2", "False"],
    ["3", "False"],
    ["4", "False"]
  ]
  ```
3) To use the variables in edX problems, you have to create relevant variables and make them global:
  - To do this use a the `globals().update()` function
  - Randomly select four (`n_total=4`) answers where one (`n_true=1`) answer is true (specified as the `correct` column by `correct_indicator='correct'`):
  ```

  globals().update(x.choices_random(data, correct_indicator='correct', n_true=1, n_total=4))
  ```
  - Note: You can now call each of your column headers in the order in which they were randomly selected from `00` to `n_total-1`:
  ```
  print (text_00, correct_00)
  > 2, False
  print (text_01, correct_01)
  > A, True
  print (text_02, correct_02)
  > 3, False
  print (text_03, correct_03)
  > 1, False
  print (text_04, correct_04)
  > NameError: name 'text_04' is not defined
  ```

5) These can be called into edX scripts as `$text_XX` and `$correct__XX` respectively. Similarly, all columns added can be called as `mycol_XX`. An example `Blank Advanced Problem` script is below:
```




Select all that apply.

$text_00
$text_01
$text_02
$text_03
None of the above



```

### Example Fingerprinting problem
This can be used to identify students that post exam problems to outside websites.

While not guaranteed to be unique, large enough lists with sufficient numbers of selected values can almost guarantee a unique result per student.

To fingerprint a problem.
1) Initialize an `x_rand` variable with the current student AID:
  - Note you should always set a random `upseed` (integer) for each problem
  ```
  x=x_rand(anonymous_student_id, upseed=100)
  ```

2) Input data:
  ```
  females = [
      ["female"],
      ["Jenny"],
      ["Carla"],
      ["Mary"],
      ["Jin"],
      ["Marta"],
      ["Sadef"]
  ]
  males = [
      ["male"],
      ["Carter"],
      ["John"],
      ["Jose"],
      ["Luke"],
      ["Adam"],
      ["Ahmed"]
  ]
  ```
3) To use the variables in edX problems, you have to create relevant variables and make them global:
  - To do this, use a simple `globals().update()` function
  - Randomly select and shuffle four (`n_total=4`) female names and four (`n_total=4`) male names:
  ```
  globals().update(x.fingerprint(females, n_total=4))
  globals().update(x.fingerprint(males, n_total=4))
  ```
  - Note: You can now call each of your column headers in the order in which they were randomly selected from `00` to `n_total-1`:
  ```
  print (female_00, male_03)
  > Jenny Carter
  ```

5) These can be called into edX scripts as `$female_XX` and `$male_XX` respectively. Similarly, all columns added can be called as `mycol_XX`. An example `Blank Advanced Problem` script is below:
```

 


Select a response below

    No
    Yes
  


```

### Recreating Student data
See `./examples` examples on how to recreate student data on your local machine.


[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job.)

[edX]: 
[python]: 

Owner

  • Name: Connor Makowski
  • Login: connor-makowski
  • Kind: user
  • Location: Cambridge, MA

Cave Lab Project Manager and Digital Learning Lead at MIT

GitHub Events

Total
Last Year

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 65
  • Total Committers: 4
  • Avg Commits per committer: 16.25
  • Development Distribution Score (DDS): 0.062
Top Committers
Name Email Commits
Connor Makowski c****8@g****m 61
Connor Makowski c****k@m****u 2
dependabot[bot] 4****]@u****m 1
Connor Makowski 3****i@u****m 1
Committer Domains (Top 20 + Academic)
mit.edu: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 year
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.13
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (8)
Top Labels
Issue Labels
Pull Request Labels
dependencies (8)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 25 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 12
  • Total maintainers: 1
pypi.org: x-rand

Random Problem Creation for edX

  • Versions: 12
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 25 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Average: 26.5%
Stargazers count: 27.9%
Forks count: 29.8%
Downloads: 43.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

dev_requirements.txt pypi
  • Mako ==1.1.2 development
  • Markdown ==3.2.2 development
  • MarkupSafe ==1.1.1 development
  • Pygments ==2.6.1 development
  • SecretStorage ==3.1.2 development
  • bleach ==3.1.5 development
  • certifi ==2020.6.20 development
  • cffi ==1.14.0 development
  • chardet ==3.0.4 development
  • colorama ==0.4.3 development
  • cryptography ==3.2 development
  • docutils ==0.16 development
  • idna ==2.10 development
  • importlib-metadata ==1.6.0 development
  • jeepney ==0.4.3 development
  • keyring ==21.2.1 development
  • packaging ==20.4 development
  • pdoc3 ==0.8.1 development
  • pkginfo ==1.5.0.1 development
  • pycparser ==2.20 development
  • pyparsing ==2.4.7 development
  • readme-renderer ==26.0 development
  • requests ==2.24.0 development
  • requests-toolbelt ==0.9.1 development
  • rfc3986 ==1.4.0 development
  • six ==1.15.0 development
  • tqdm ==4.47.0 development
  • twine ==3.2.0 development
  • urllib3 ==1.25.9 development
  • webencodings ==0.5.1 development
  • zipp ==3.1.0 development
examples/fingerprint/requirements.txt pypi
  • x-rand ==0.11
setup.py pypi
  • random2 >=1
requirements.txt pypi