# Time estimates and edx-val

**URL:** <https://discuss.openedx.org/t/time-estimates-and-edx-val/9554>\
**Category:** Site Operators\
**Tags:** tutor\
**Created:** [March 10, 2023, 6:46pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554 "2023-03-10T18:46:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [March 10, 2023, 6:46pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/1 "2023-03-10T18:46:02Z")

</div>

Hello everyone,

Since we recently moved from Native Koa to Tutor Nutmeg, we had the pleasure of discovering the time estimates that were introduced as part of the [Learning Micro-frontend Now Default in Maple - Open edX](https://openedx.org/blog/learning-micro-frontend-now-default-in-maple/)

One of the things we quite do not understand if how edx-val is populated.

If I look in the Django Admin section edxval not all courses are present and for those who are the duration is always 0,0.

From what I could discover, the video ID from Studio seems to be in direct relation with transcripts uploaded for the videos, which would explain why some videos without transcripts are not present in this table.

So, can someone please explain how does edxval works and how we can get the estimated times from each video?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [March 13, 2023, 3:37pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/2 "2023-03-13T15:37:27Z")

</div>

I have confirmed by using [MW Metadata](https://mattw.io/youtube-metadata/) that the videos definitely have a duration in their metadata.

Is it because the Client Video ID is considered “external video” under admin/edxval/video/ ?

Is there a management command to run in order to populate the duration?

By the way, and before you ask, I can clearly see the activities estimates when I do not add a video, so I know it is not a question of republishing the course.

I am basing my hypothesis on  
[https://github.com/openedx/edx-platform/blob/open-release/nutmeg.master/openedx/features/effort\_estimation/block\_transformers.py](https://github.com/openedx/edx-platform/blob/open-release/nutmeg.master/openedx/features/effort_estimation/block_transformers.py)

where it is stated that

> ```
> If there is any missing data (like no video duration), we don't provide any estimates at all for the course.
> We'd rather provide no estimate than a misleading estimate.
> 
> ```

Does anyone have an example of a course where the video duration estimates are working?

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [March 13, 2023, 4:40pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/3 "2023-03-13T16:40:17Z")

</div>

I was curious, so I tried 2 courses that started today on [edx.org](http://edx.org)

course-v1:HarvardX+PH125.1x+3T2022  
course-v1:HarvardX+CS50P+Python

and none of them have estimates when I look at the course contents.

There are “esimated” in course-v1:GoogleCloud+GCCF1x+3T2022 but I believe this is because they forced it in their section titles and not because the Learning MFE estimates are turned on.

Can anyone confirm if the video duration estimates do work in Open edX ?

---

<div class="post-metadata">

**Author:** ![Andres.Aulasneo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/andres.aulasneo/32/984_2.png) [@Andres.Aulasneo](https://discuss.openedx.org/u/Andres.Aulasneo)\
**Post date:** [April 19, 2023, 10:16pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/4 "2023-04-19T22:16:07Z")

</div>

Hi @sambapete!  
Looks like I’m stumbling in the same stone. Did you have any progress since then? I couldn’t find any part in the code that updates the video information in edx-val.

---

<div class="post-metadata">

**Author:** ![sambapete](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/sambapete/32/4100_2.png) [@sambapete](https://discuss.openedx.org/u/sambapete)\
**Post date:** [April 20, 2023, 4:20am UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/5 "2023-04-20T04:20:26Z")

</div>

Hi @Andres.Aulasneo

I haven’t found anything. And as you can see nobody answered me except you.

---

<div class="post-metadata">

**Author:** ![Andres.Aulasneo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/andres.aulasneo/32/984_2.png) [@Andres.Aulasneo](https://discuss.openedx.org/u/Andres.Aulasneo)\
**Post date:** [April 21, 2023, 2:55pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/6 "2023-04-21T14:55:09Z")

</div>

I’ve been investigating a bit and this is what I’ve found:

- Effort is [collected only for HTML (including Text) and video](https://github.com/openedx/edx-platform/blob/06969e6c505e6ab4d853df93e86a03fb524af927/openedx/features/effort_estimation/block_transformers.py#L72-L82) components.
- HTML effort is calculated in base of 265 words per minute, which is [hardcoded](https://github.com/openedx/edx-platform/blob/151c4fcfb29473fa6358423d160b0cfc02d2b18f/openedx/features/effort_estimation/block_transformers.py#L49).
- If any block (especially video) is missing information, [no effort estimation will be shown in the course](https://github.com/openedx/edx-platform/blob/06969e6c505e6ab4d853df93e86a03fb524af927/openedx/features/effort_estimation/block_transformers.py#L84-L88) at all.
- Video information is collected by the edx-val module, but I haven’t found any place where it is fulfilled automatically.
- Edx-val is involved mainly by two tables: [Video](https://github.com/openedx/edx-val/blob/bcd83ee0c87fa2a80578ddaa6cad884c7ac5961d/edxval/models.py#L93) and [CourseVideo](https://github.com/openedx/edx-val/blob/bcd83ee0c87fa2a80578ddaa6cad884c7ac5961d/edxval/models.py#L154). Both can be edited in Django admin.
- Video is not populated when a new video is uploaded (shouldn’t it?). But a record is created when you upload a transcript. Its PK is [edx-video-id](https://github.com/openedx/edx-val/blob/bcd83ee0c87fa2a80578ddaa6cad884c7ac5961d/edxval/models.py#L105-L115). It is [generated by edx-val](https://github.com/openedx/edx-val/blob/bcd83ee0c87fa2a80578ddaa6cad884c7ac5961d/edxval/api.py#L71) and only called when a transcript is [uploaded](https://github.com/openedx/edx-platform/blob/151c4fcfb29473fa6358423d160b0cfc02d2b18f/cms/djangoapps/contentstore/views/transcripts_ajax.py#L208-L209) or [updated](https://github.com/openedx/edx-platform/blob/151c4fcfb29473fa6358423d160b0cfc02d2b18f/cms/djangoapps/contentstore/views/transcripts_ajax.py#L81-L82).
- CourseVideo is also important because [only videos declared there will be collected](https://github.com/openedx/edx-platform/blob/151c4fcfb29473fa6358423d160b0cfc02d2b18f/openedx/features/effort_estimation/block_transformers.py#L105). If there is a single video in the course not declared in CourseVideo, it will [raise a MissingEstimationData exception](https://github.com/openedx/edx-platform/blob/151c4fcfb29473fa6358423d160b0cfc02d2b18f/openedx/features/effort_estimation/block_transformers.py#L112) and no estimation will be shown for the whole course.
- Adding a translation will create a Video object but not a CourseVideo object, because it is created as an external video [not linked to any course](https://github.com/openedx/edx-val/blob/bcd83ee0c87fa2a80578ddaa6cad884c7ac5961d/edxval/api.py#L130). But you can create it manually in Django admin.

So, to work around, for each video in a course:

- Check if it already has an `edx_video_id` assigned (see the staff debug info in the LMS).
- If it does not have an `edx_video_id`, create one manually in Django admin \> Edxval \> Video.
- Set manually the video duration in seconds
- Assign it to your course id there in the same page  
Once finished with all videos, publish the course and in a few seconds all units should show the estimated effort in the course outline.

Questions are… are we missing something? Is it documented somewhere? Is it work-in-progress? What is the roadmap for this feature?

It would be great if someone in the core team comes and clarifies the status of the feature.

---

<div class="post-metadata">

**Author:** ![marcotuts](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/marcotuts/32/4861_2.png) [@marcotuts](https://discuss.openedx.org/u/marcotuts)\
**Post date:** [April 8, 2024, 3:30pm UTC](https://discuss.openedx.org/t/time-estimates-and-edx-val/9554/7 "2024-04-08T15:30:05Z")

</div>

@volodymyr.chekyrta and I discussed something very similar to this today as it relates to Mobile video download file size estimation / duration.

Ensuring that edx-val is broadly adopted / turned on by default, OR having more reliable access to video file size seems like a metadata gap potentially?

Volodymyr found this line that uses val to “getvideoinfo” for our use case as a reference in case it helps: [edx-platform/xmodule/video\_block/video\_block.py at b706e600a0afc66f985762e06bf6348bc685fb0a · openedx/edx-platform · GitHub](https://github.com/openedx/edx-platform/blob/b706e600a0afc66f985762e06bf6348bc685fb0a/xmodule/video_block/video_block.py#L1205)

There may be other gaps in video metadata besides the items highlighted in this thread, so +1 to continued discovery / input from core team members.
