RESQUE-Framework / website

The Research Quality Evaluation Scheme
https://resque-framework.github.io/website/
MIT License
2 stars 3 forks source link

Store customization variables in JSON (not hardcoded) #48

Closed nicebread closed 1 year ago

nicebread commented 1 year ago

Extract some customization variables from index.html and put them into the json file (core-meta.json?), e.g. line 611:

if (scoringResult.max < 5 && scoringResult.max > 0) The "5" could be min_indicators_warning_threshold.

Same for #47: min_RO_warning_threshold

(Background: Hiring committees should easily adjust these values to their needs).

alpkaanaksu commented 1 year ago

I think menu.js is a better place for this kind of modifications (this is why we have it in the first place). Ideally, commitees do not have to change the core packs for customizations. We could also have 2 standalone packs, which happen to be combined for a use case, which value for the min_indicators_warning_threshold is valid?

async function menu() {
    return {
        // Global customization variables
        max_RO: 12,
        max_top_papers: 3,
        min_RO_warning_threshold: 5,

        meta: pick(await use(
            // RO specific customization variables
            { min_indicators_warning_threshold: 5 },
            "core-meta"
        )),

        pub: pick(await use("core-pubs")),

        software: pick(await use("core-software")),

        data: pick(await use("core-data"))
    }
}

@nicebread What do you think?

nicebread commented 1 year ago

Yes, great! (I was not aware of menu.js, this indeed is the right place). Some day we need a short manual that explains for committees (as non-technical as possible), where they can change these customization variables.

The min_indicators_warning_threshold probably should be pack-specific (i.e., different values for pubs, data sets, and software)

alpkaanaksu commented 1 year ago

Those variables are now stored in menu.js. (c0fcaef38d760ba475fc69ad5d47c889709c4b24)

async function menu() {
    return {
        config: {
            max: 12,
            maxTopPapers: 3,
            minROWarningThreshold: 5,
        },

        meta: pick(await use({
            minIndicatorsWarningThreshold: 5
        }, "core-meta")),

        pub: pick(await use({
            minIndicatorsWarningThreshold: 5
        }, "core-pubs")),

        software: pick(await use({
            minIndicatorsWarningThreshold: 5
        }, "core-software")),

        data: pick(await use({
            minIndicatorsWarningThreshold: 5
        }, "core-data"))
    }
}

And then you can use them like config.max.