# Enable ORA Grading MFE in Tutor Olive

**URL:** <https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503>\
**Category:** Site Operations Help\
**Tags:** tutor, mfe, tutor-mfe\
**Created:** [March 12, 2024, 7:54am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503 "2024-03-12T07:54:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![khushi](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@khushi](https://discuss.openedx.org/u/khushi)\
**Post date:** [March 12, 2024, 7:54am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/1 "2024-03-12T07:54:38Z")

</div>

I want to enable ora-grading mfe in tutor 15.3.5. I found one similar [topic](https://discuss.openedx.org/t/how-to-add-frontend-app-ora-grading-to-tutor-mfe/9977) but still can’t figure out the exact way. Please suggest detailed steps to add ora-grading in Tutor Olive (15.3.5). Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Anh\_Vu\_Nguy\_n](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/anh_vu_nguy_n/32/1740_2.png) [@Anh\_Vu\_Nguy\_n](https://discuss.openedx.org/u/Anh_Vu_Nguy_n)\
**Post date:** [March 12, 2024, 11:44am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/2 "2024-03-12T11:44:52Z")

</div>

are you a developer?  
You can refer to [this PR](https://github.com/overhangio/tutor-mfe/pull/89/files) and make a plugin to apply it.  
You will need do the following:

- Add ORA\_GRADING\_MICROFRONTEND\_URL
- Add a custom MFE [ORA Grading](https://github.com/openedx/frontend-app-ora-grading)
- Create a waffle flag openresponseassessment.enhanced\_staff\_grader and enable it to everyone.

---

<div class="post-metadata">

**Author:** ![khushi](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@khushi](https://discuss.openedx.org/u/khushi)\
**Post date:** [March 13, 2024, 5:25am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/3 "2024-03-13T05:25:26Z")

</div>

Thanks for the reply! I’m a newbie openedx developer, hence finding difficulty in creating the plugin. I’ve added this in my plugin.py

```auto
from tutormfe.plugin import MFE_APPS
@MFE_APPS.add()
def _add_my_mfe(mfes):
    mfes["ora-grading"] = {
        "repository": "https://github.com/openedx/frontend-app-ora-grading.git",
        "port": 1993,
        "version": "open-release/olive.4",
    }
    return mfes

```

but I’m getting this error

```auto
tutor plugins enable ora
Error applying action 'plugins:loaded:ora': func=<function discover_package.<locals>.load at 0x7f32ef5bb940> contexts=['plugins']'
Traceback (most recent call last):
  File "env/bin/tutor", line 8, in <module>
    sys.exit(main())
  File "env/lib/python3.8/site-packages/tutor/commands/cli.py", line 26, in main
    cli() # pylint: disable=no-value-for-parameter
  File "env/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "env/lib/python3.8/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "env/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "env/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "env/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "env/lib/python3.8/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "env/lib/python3.8/site-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "env/lib/python3.8/site-packages/tutor/commands/plugins.py", line 140, in enable
    plugins.load(plugin)
  File "env/lib/python3.8/site-packages/tutor/plugins/ __init__.py", line 93, in load
    hooks.Actions.PLUGIN_LOADED(name).do()
  File "env/lib/python3.8/site-packages/tutor/core/hooks/actions.py", line 122, in do
    self.do_from_context(None, *args, **kwargs)
  File "env/lib/python3.8/site-packages/tutor/core/hooks/actions.py", line 141, in do_from_context
    callback.do(
  File "env/lib/python3.8/site-packages/tutor/core/hooks/actions.py", line 35, in do
    self.func(*args, **kwargs)
  File "env/lib/python3.8/site-packages/tutor/plugins/v1.py", line 77, in load
    entrypoint.load()
  File "env/lib/python3.8/site-packages/pkg_resources/ __init__.py", line 2443, in load
    return self.resolve()
  File "env/lib/python3.8/site-packages/pkg_resources/ __init__.py", line 2449, in resolve
    module = __import__ (self.module_name, fromlist=[' __name__'], level=0)
  File "/ora_grading/enable_ora/plugin.py", line 10, in <module>
    from tutormfe.plugin import MFE_APPS
ImportError: cannot import name 'MFE_APPS' from 'tutormfe.plugin' (env/lib/python3.8/site-packages/tutormfe/plugin.py)

```

I also added ORA\_GRADING\_MICROFRONTEND\_URL in below file tutor/env/apps/openedx/settings/lms/developmemt.py, and openresponseassessment.enhanced\_staff\_grader waffle flag

What am I missing?

---

<div class="post-metadata">

**Author:** ![vivek](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/vivek/32/6825_2.png) [@vivek](https://discuss.openedx.org/u/vivek)\
**Post date:** [March 13, 2024, 11:27am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/4 "2024-03-13T11:27:48Z")

</div>

@khushi i think there is an issue with import .  
could you try using this

```auto
from tutormfe.hooks import MFE_APPS

@MFE_APPS.add()
def _add_my_mfe(mfes):
    mfes["mymfe"] = {
        "repository": "https://github.com/myorg/mymfe.git",
        "port": 2001,
        "version": "me/my-custom-branch-or-tag", # optional, will default to the Open edX current tag.
    }
    return mfes

```

Hope it help !

---

<div class="post-metadata">

**Author:** ![khushi](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@khushi](https://discuss.openedx.org/u/khushi)\
**Post date:** [March 13, 2024, 1:53pm UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/5 "2024-03-13T13:53:31Z")

</div>

I tried this too but getting similar import error! I think it is because my tutor (version 15.3.5 ) is not having hooks.py in this path - env/lib/python3.8/site-packages/tutormfe/

```auto
ImportError: cannot import name 'MFE_APPS' from 'tutormfe.hooks' 

```

How can I solve this?

---

<div class="post-metadata">

**Author:** ![vivek](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/vivek/32/6825_2.png) [@vivek](https://discuss.openedx.org/u/vivek)\
**Post date:** [March 14, 2024, 4:36am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/6 "2024-03-14T04:36:33Z")

</div>

@khushi , yes you get it right .  
you can check here for more info on this

> **[GitHub - overhangio/tutor-mfe: This plugin makes it possible to easily add...](https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#adding-new-mfes)**
>
> This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor. - overhangio/tutor-mfe

i think you should do something like this

**`Adding new MFEs`**

Other Tutor plugin developers can take advantage of this plugin to deploy their own MFEs. To declare a new MFE, a new configuration setting should be created with the “\_MFE\_APP” suffix. This configuration setting should include the name, git repository (and optionally: git branch) and development port. For example:

```auto
config = {
    "defaults": {
        "MYMFE_MFE_APP": {
            "name": "mymfe",
            "repository": "https://github.com/myorg/mymfe",
            "port": 2001,
            "version": "me/my-custom-branch", # optional
        }
    }
}

```

The MFE assets will then be bundled in the “mfe” Docker image whenever it is rebuilt with tutor images build mfe. Assets will be served at http(s)://{{ MFE\_HOST }}/{{ MYMFE\_MFE\_APP[“name”] }}. Developers are free to add extra template patches to their plugins, as usual: for instance LMS setting patches to make sure that the LMS correctly connects to the MFEs.

* * *

Check for your mfe version and then go to Release history =\> [tutor-mfe · PyPI](https://pypi.org/project/tutor-mfe/15.0.6/#history)  
and check in Project description . i think you can get your answers there , i also added that block related to add new mfe from there .  
hope , it work now !

---

<div class="post-metadata">

**Author:** ![Anh\_Vu\_Nguy\_n](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/anh_vu_nguy_n/32/1740_2.png) [@Anh\_Vu\_Nguy\_n](https://discuss.openedx.org/u/Anh_Vu_Nguy_n)\
**Post date:** [March 14, 2024, 10:03am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/7 "2024-03-14T10:03:06Z")

</div>

Check your tutor mfe version and use a corresponding method. For tutor mfe v15, you can use [this doc](https://github.com/overhangio/tutor-mfe/tree/v15.0.6?tab=readme-ov-file#adding-new-mfes).

---

<div class="post-metadata">

**Author:** ![khushi](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@khushi](https://discuss.openedx.org/u/khushi)\
**Post date:** [March 18, 2024, 6:38am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/8 "2024-03-18T06:38:27Z")

</div>

I added ora-grading in the config and built the mfe image but start -d gives this error as the docker image for ora-grading version 15 is not found

```auto
"ORA_GRADING_MFE_APP": {
            "name": "ora-grading",
            "repository": "https://github.com/openedx/frontend-app-ora-grading",
            "port": 1993,
        },

```

```auto
docker compose -f /tutor/env/local/docker-compose.yml -f /tutor/env/local/docker-compose.prod.yml -f /tutor/env/local/docker-compose.tmp.yml --project-name tutor_local stop
docker compose -f /tutor/env/local/docker-compose.yml -f /tutor/env/dev/docker-compose.yml -f /tutor/env/dev/docker-compose.tmp.yml -f /tutor/env/dev/docker-compose.override.yml --project-name tutor_dev up --remove-orphans --build -d ora-grading
[+] Running 1/1
 ✘ ora-grading Error 9.7s 
Error response from daemon: manifest for overhangio/openedx-ora-grading-dev:15.0.7 not found: manifest unknown: manifest unknown
Error: Command failed with status 18: docker compose -f /tutor/env/local/docker-compose.yml -f /tutor/env/dev/docker-compose.yml -f /tutor/env/dev/docker-compose.tmp.yml -f /tutor/env/dev/docker-compose.override.yml --project-name tutor_dev up --remove-orphans --build -d ora-grading

```

---

<div class="post-metadata">

**Author:** ![Anh\_Vu\_Nguy\_n](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/anh_vu_nguy_n/32/1740_2.png) [@Anh\_Vu\_Nguy\_n](https://discuss.openedx.org/u/Anh_Vu_Nguy_n)\
**Post date:** [March 18, 2024, 8:06am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/9 "2024-03-18T08:06:37Z")

</div>

That config works for `tutor local` or `tutor k8s`  
For `tutor dev` you have to use **bind mount** according to [the doc](https://github.com/overhangio/tutor-mfe/tree/v15.0.6?tab=readme-ov-file#mfe-development).  
If you’ve built the mfe image then you can run `tutor local launch` or `tutor local quickstart`, I don’t remember the exact syntax for v15.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)\
**Post date:** [June 16, 2024, 8:07am UTC](https://discuss.openedx.org/t/enable-ora-grading-mfe-in-tutor-olive/12503/10 "2024-06-16T08:07:05Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
